Implement QuirksMode and JavaScript

I would like to ask if Internet Explorer in QuirksMode has a different JavaScript implementation than IE in normal mode (when the doctype is correctly defined).

Is it possible that JavaScript code will behave differently in QuirksMode and in normal IE mode?

+3
source share
3 answers

Yes .

One of the most noticeable differences is that in quirks mode BODY (document.body) is considered the root element , while in standard mode (and how it should be) the root element is HTML (document.documentElement).

, , ; document.documentElement.clientHeight, quirks - document.body.clientHeight - .

- document.documentElement.clientHeight == 0 - , documentElement , .

, , , CSS, . , .

+10

JavaScript -; DOM, JavaScript, .

+6

In Internet Explorer 8, where the full mode of standards no longer receives <a name="foo">upon request document.getElementById('foo')and where (IIRC) setAttributeand friends are fixed.

+3
source

Source: https://habr.com/ru/post/1719008/


All Articles