MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
September
Sun Mon Tue Wed Thu Fri Sat
       
13
 
2016
Months
Sep


Tue, Sep 13, 2016 11:19 pm

Check screen resolution and window size with JavaScript

A simple way to check the screen resolution of a visitor to a website is by the following JavaScript:

<script type="text/javascript">
document.write(screen.width+'x'+screen.height);
</script>

The results of the above code would be as shown below. The numbers represent the resolution in pixels.

Or if you prefer the values to be displayed on separate lines you could use the code below:

<script type="text/javascript">
document.write('Width: '+screen.width+'<br>'+'Height: '+screen.height);
</script>

[ More Info ]

[/languages/javascript] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo