Skip to content Skip to sidebar Skip to footer

Javascript And Doctype In Firefox Bug

i have this javascript code : function pageWidth() { return (window.innerWidth != null ? window.innerWidth : (document.body != null ? document.body.

Solution 1:

In quirks mode (no doctype or a quirks mode doctype), document.body.scrollWidth actually returns the scrollWidth of the document instead of the body in some cases. In standards mode (with most doctypes), it returns the scrollWidth of the body, and document.documentElement.scrollWidth returns the scrollWidth of the document in some cases. See http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth for the spec draft for this.


Post a Comment for "Javascript And Doctype In Firefox Bug"