Archive for the 'JavaScript' Category

I’ve been doing some HTML/CSS/JS work for various clients at work recently and I’ve come across some very useful articles/tips for doing stuff. I’m sure none of this is new but if I only encountered it recently, maybe others haven’t yet.

Selfclearing Elements - Don’t you hate it when you float an element and the container doesn’t get the height correctly. Then, maybe you float the container, but that causes problems with other things. Then you try adding an element just to hang a clear on to fix it and now you’re cluttering up your pristine markup with garbage… There is a solution and it’s even elegant.

z-index/stacking - So, if you want something to appear above something else on a page, you just give it a higher z-index, right? That’s what I’ve always thought but I was never really satisfied with that because it didn’t always work the way I expected it to. I didn’t totally understand it so, when I had to fix something with z-indexes, I tended to just try different values in different places until I found something that works. No more. I found Overlapping and Z index and now it all makes sense.

JavaScript the JSON way - It’s pretty amazing how far the JavaScript language has come in the last few years. One of the coolest things I’ve seen recently is the technique for organizing your code with JSON to prevent function name collision and make things generally cleaner. Dustin Diaz has a great introduction to the method that will get you rolling with the JSON goodness.

I’ve been doing JavaScript programming off and on for a number of years and I feel pretty competent. I know I don’t have a super deep grasp of the fundamentals but I understand how AJAX works, the benefits of sandboxing your code with JSON and some of how libraries such as jQuery and prototype work. I knew that there were gaps and that I didn’t have the real grounding necessary to totally understand how everything works but I never thought much about how to go about filling in the blanks.

Then I came across this blog post yesterday. I’ve watched parts 1 and 2 and I’m really impressed by how Douglas Crockford clearly and succinctly presents very basic info on the language and is laying the groundwork for a much better understanding of it. I know feel like I’ve got a really good grasp on concepts that before I sort of understood.

The lectures are very watchable and I really encourage anyone who’s interested in learning JavaScript or getting a better understanding of the fundamentals to watch them.