Hi All, This is the parent issue that led to the post [B]Need help with getDOCTYPE() function[/B] ([url]http://www.daniweb.com/forums/thread196837.html[/url]) [B]USING THE BODY METHOD:[/B] The following code will properly get the viewable window area if no DOCTYPE is specified. [icode]document.getElementsByTagName("body")[0].clientWidth//Height[/icode] [B]OR[/B] [icode]document.body.clientWidth//Height[/icode] If DOCTYPE is XHTML ANY* the above code reports only the defined page area as if it was a wraper**. [B]USING THE HTML METHOD:[/B] The following code will properly get the viewable window area when DOCTYPE XHTML ANY* is used. [icode]document.getElementsByTagName("html")[0].clientWidth//Height [/icode] [B]OR[/B] [icode]document.documentElement.clientWidth//Height [/icode] If no DOCTYPE is used the above code reports only the defined page area as …

Member Avatar
Member Avatar
+0 forum 3

Hi All, Without getting into too much history on the why, I came into a situation where I needed to create a function to get various properties of !DOCTYPE so that other functions could adjust to work properly with certain DOCTYPEs (Strict, Transitional, etc.). I have tested the function in the following Windows browsers IE6+ FF3+ Chrome2+ and Safari3+ Opera9+. The only one that I can’t get working is Opera (testing with 9.64). I’m hoping that someone out that has a solution! Here is the code: [code] function getDOCTYPE(loc){ loc=locEval(loc)||self; // locEval is a function i use to qualify window/frame …

Member Avatar
Member Avatar
+0 forum 3

The End.