IE – How Do I Get innerWidth in Internet explorer 8

The Javascript innerWidth property returns the inner width of a window’s content area.
The Javascript innerHeight property returns the inner height of a window’s content area.

Syntax:
To get the content area width
var w = window.innerWidth;

To get the content area height
var h =  window.innerHeight;

 

Browser support :  innerHeight and innerWidth properties are supported in all major browsers.

These properties are not supported in Internet Explorer 8 and earlier.

 

To get the innerWidth and innerHeight in IE8 and earlier, you can do this instead.

document.documentElement.clientWidth;

document.documentElement.clientHeight;

or

you may use

jquery .width() and .height() function like this

var w = $(window).innerWidth()

var h =   $(window).innerHeight()