I have the follow script, which does get the screen width/height, but it does so only after a page refresh;
function getWidth(){
if(self.innerWidth){
return self.innerWidth;
}
if(document.documentElement && document.documentElement.clientHeight){
return documentElement.clientWidth;
}
if(document.body){
return document.body.clientWidth;
}
}
I would like to know if there are other alternatives to getting screen width/height of a browse as it happens.