1var clientWidth = document.documentElement.clientWidth;
2 $("h2").text(clientWidth);
1var win = window,
2 doc = document,
3 docElem = doc.documentElement,
4 body = doc.getElementsByTagName('body')[0],
5 x = win.innerWidth || docElem.clientWidth || body.clientWidth,
6 y = win.innerHeight|| docElem.clientHeight|| body.clientHeight;
7alert(x + ' × ' + y);