web hosting and development forums
Web Design and Development Forums Archive


Index - JavaScript forum

detecting that a browser has a buggy DOM implementation


Post reply

I'm playing with the DOM and I need to make the difference between good browsers (FF) and IE alike. What's the best way to detect that a browser has a buggy (IE) DOM implementation ?
froomzer, snag a library that abstracts the browser differences for you
Koplaf, have a name that I can google for ?
froomzer, My standard suggestion is to take a look at how quirksmode does it. :) It's not a library though.
PPK ?
Yes.
Has the script your thinking about a name or so, because he has a lot of stuffs on his webstie
Ie http://www.quirksmode.org/quirksmode.js
Okay I'll find it thanks a lot THink I found it. Basically he is sniffing the browser name.
Not really He has one bit of browser name sniffing. And that's only to catch old and really shitty browsers that no one would falsely claim to be using.
I was thinking about method support detection such as id (document.all) but DOM support is no method... Look he has a browser var And does for instance if (browser != 'IE 5.0')
Yes. This is not his only browser specific code.. There are plenty of other examples where he tests for specific functionality
Mmh I dont found a if (buggyDOM) ...
froomzer, You will note that the second variable he declares is "W3CDOM"
Yes was just looking that. In fact var browser is only used for IE 5.0 which AFAIK really buggy
Yes The major feature to observe is that most of his code tests for something being possible before attempting it. This is probably the most important thing to bear in mind for making sure that your javascript doesn't break things. (I wouldn't neccesarily recommend all features of this script. But PPK knows a shit load more than I do, so some of the things I wouldn't recommend I might be plain wrong about. :) )
Yes that the reason why I wanna to test methods not sniff browser name
As I said. All the sniffing of browser name does is check if the user is using a sufficiently shitty browser that it's not worth trying various things.
I think I understand now the strategy : if super crappy IE 5.0 do nothing else if IE 5.xxx do buggy way else do normal things




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com