Tutorial :How to guess browser compatibility based upon DOM Level?



Question:

Is there a simple rule-of-thumb to know approximately which browser versions and upward will be compatible with a given DOM level?


Solution:1

You may use feature detection:

  • DOM-Events Level 2: document.implementation.hasFeature("Events", "2.0")
  • DOM-Core Level 2: document.implementation.hasFeature("Core", "2.0"))
  • DOM-XPath Level 3: document.implementation.hasFeature("XPath", "3.0")

Camp 1: Gecko (Firefox, Mozilla), WebKit (Safari, Chrome), Presto-based (Opera) browsers support DOM Core/Events/XPath Level 2, some of them support Level 3.0

Camp 2: Trident-based (Internet Explorer) support DOM Level 0 (which is not a standard)

Hope this helps.

Worth noticing, there is Ample SDK Ajax GUI framework that enables DOM Level 2/3 in Internet Explorer as well as in other browsers by re-implementing it.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »