SoFunction
Updated on 2025-03-01

How to get the JS method of the browser page area size


//It can be used under IE, FireFox, and Opera


//It is easy to obtain, very convenient.
//In the company's projects:
//Opera is still used


//But IE and FireFox use


//It turns out that the W3C standard is causing trouble.
//http:///TR/xhtml1/DTD/”>
//If you add this line of mark on the page

//In IE:
==> BODY object width
==> BODY object height
==> Visible area width
==> Visible area height
//In FireFox:
==> BODY object width
==> BODY object height
==> Visible area width
==> Visible area height
?
//In Opera:
==> Visible area width
==> Visible area height
==> Page object width (i.e. BODY object width plus Margin width)
==> Page object height (i.e. BODY object height plus Margin height)
//If there is no standard for W3C definition,
//IE is:
==> 0
==> 0
//FireFox is:
==> Page object width (i.e. BODY object width plus Margin width) ==> Page object height (i.e. BODY object height plus Margin height)
//Opera is:
==> Page object width (i.e. BODY object width plus Margin width) ==> Page object height (i.e. BODY object height plus Margin height)