Forum Moderators: open

Message Too Old, No Replies

Quirks to strict mode in IE

Are there Javascript implications?

         

Robin_reala

11:21 am on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We're redoing an older web app of ours and want (for styling purposes) to move from quirks mode to strict. I can think of a couple of changes needed to be made to the JS straight away - 'px' on units, '#' on colours - but is there anything more fundamental that might be an issue?

Thanks!

RonPK

12:38 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Certain properties move up in the DOM hierarchy.
scrollTop
is one that comes to mind: in strict mode, it no longer belongs to
body
but becomes a property of the
documentElement
element. Try this to see it in action in different modes:

alert(document.body.scrollTop); 
alert(document.documentElement.scrollTop);

(make sure there is a scrollbar...)

Edit: this also applies to

scrollLeft, offsetWidth, offsetHeight
and probably a few more.

[edited by: RonPK at 12:42 pm (utc) on Oct. 9, 2006]

Robin_reala

2:04 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah yeah, I remember seeing that on Quirksmode. Thanks!