AJAX getWidth()- and getHeight()-blues
handgestrickt wanted to cover the complete content of a browser window with a fading layer. so we needed to know how the width and height of the document.body. in all browsers using Prototype.js and document.body.getWidth() and document.body.getHeight() did a good job. guess in which browser not? bingo! M$ Internet Exploiter 7. isn't it strange that most JavaScript-code contains tons of workarounds for Internet Explorer and Safari. maybe we all need some holidays in a country where the sun is shining. here is another workaround:
var foo = {
winWidth: function() { return document.body.offsetWidth || window.innerWidth || document.documentElement.clientWidth || 0; },
winHeight: function() { return document.body.offsetHeight || window.innerHeight || document.documentElement.clientHeight || 0; }
}

