Been using Javascript libraries like Prototype and jQuery for development, for a while now. While its a boon using those libraries, the one downside is that using such libraries probably doesn't help in understanding what happens under the hood.
Many Thanks in advance
So how does one master DOM?
This is almost as general as saying "How does one master programming?", but I'll give it a shot.
Practice is key. You can't just read a few books and become good with it. You need practice, and experience to know what exactly is going on when you do different things, and how different browsers interpret what you're doing.
Of course, there are things you can do, one is to start taking tutorials at HTML Dog (check out JavaScript & HTML DOM in left menu). Also, check out caniuse.com so you can see what is supported in the DOM. Blogs are a great help, too. John Resig's blog (creator of jQuery) is a good resource for some more advanced DOM techniques. Taking a look into how JavaScript libraries' code to see how they do things. This will give you some ideas as to where to start. Of course, you need to have some knowledge & understanding of the DOM for this to be useful, first. The DOM is a mess, so it can take lots of time and patience to really master it.
You'll need to master the following, in a cross browser way, which is why it's much better to use an already written framework.
Will understanding DOM be of more help when using Javascript libraries?
Yes. JavaScript libraries are great, but you can do some very unfavorable things in JavaScript frameworks if you don't know what they framework is (essentially) doing behind the scenes. For example, jQuery selectors are designed to traverse the DOM in a specific way. If you don't understand how jQuery traversal works, it can have significant performance implications depending on your circumstances.
Of course, you should almost never do development without a JavaScript framework. Pick one that meets your needs and master it. It's much better than trying to re-invent the wheel (unless you plan on learning more about wheels).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With