Javascript Detecting Screen Resolution

Javascript Detecting Screen Resolution

In this post, I want to share about Javascript Detecting Screen Resolution. In this case you can detect user screen resolution. Javascript Detecting Screen Resolution will be very usefull to help you in designing the layout of your page.

Lets just jump to Javascript Detecting Screen Resolution.

<script language="javascript">
function detect(){
	alert('Width='+screen.width+' \n Height='+screen.height);
}
</script>
<input type="button" value="Detect Resolution" onclick="detect()" />

Indeed, Javascript Detecting Screen Resolution is prety simple code, however it will be powerfull if you combine it with other code while desinging your page.

Just copy the above code into the body of your page, and Javascript Detecting Screen Resolution will be working.

http://septiadi.com/2011/04/27/javascript-detecting-screen-resolution/


Leave a comment