innerWidth supported by IE9, not IE8, you can do this:
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
In the above line, you will get the width from IE, as well as other standard compatible browsers.
If you use jQuery, $(window).innerWidth() will also give you the desired result in all browsers.
Sarfraz Feb 23 '12 at 9:24 2012-02-23 09:24
source share