jQuery Tip: Validate your XHTML!
I’ve just been playing around with jQuery. It’s an amazing framework. It really speeds up development, and make RIA development for the web very easy - much easier than Flash. The only drawback is that browser compatibility becomes an issue. I created a friend manager and avatar builder using jQuery, and after launch I got a lot of reports from users of IE7 on Vista. It seems that jQuery was crashing their browser.
I went back and took a hard look at my implementation and did some digging on the net. I’ve heard reports that malformed XHTML can wreak havoc with the browser’s ability to crawl the DOM. So, I had to go back and make sure I had no XHTML errors. That included th base template and all dynamic updates to the XHTML document. I validated all possible permutations of the XHTML using Firefox’ Web Developer Add-on Tools -> Validate Local HTML.
It seems that making sure all the XHTML was valid solved the problem for most people. I must say, though, that all other browsers were fine with the original implementation - even IE7 on Windows XP. It seems that IE7 for Vista is much more fragile - which is very odd because you’d think IE7 on XP and Vista would behave the same way. So, holding my nose, I just bought a copy of Vista for testing.
On another note - Google Chrome did just fine with it as well. It just did it faster.


