HTML & JavaScript Compatibility Hell for Programmers
If you are HTML Designer or JavaScript programmer, then you may already know the rule that it almost 50% of the development time to make what works in browser, and another 50% of the time is spent to run it smoothly in all the other popular browsers (some time it takes even more).
Recently, I was working on script where from the on-click event handler I have to find and return the containing iFrame reference. Searching on the Google, I found that you can do this by using something like:
var winReference = activeElement.ownerDocument.parentWindow.frameElement;
But guess what, it was only working in the IE. So now I have to start again the search for the alternatives which works in the all other browsers as well. Doing this, I found one of my long waited reference link:
http://www.quirksmode.org/compatibility.html
The above link contains the comparability tables for the HTML, CSS and DOM. Lot more than what I was expecting. A big thanks to Peter-Paul Koch for maintaining these tables and sharing with the community. It’s now my #1 resource for the compatibility reference.
BTW, for some of you who don’t want to go the compatibility link, the answer to find the parent window reference in the FireFox and other browses is:
var winReference = activeElement.ownerDocument.defaultView.frameElement;
Next time, don’t hit the wall when you stumbled upon some JavaScript issues, check the compatibility tables first.
Tags: Compatability, JavaScript
This entry was posted
on Saturday, May 29th, 2010 at 10:53 am and is filed under HTML & CSS, Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Feedback & Comments
No Responses