Get visitor screen resolution using javascript
Get visitor screen resolution using javascript
Get visitor screen resolution using javascript
This script helps you to find screen resolution of a client / user machine and redirect to a webpage. In the code below I am checking 3 different screen resolutions like 640×480 , 800×600 and 1024×768
<script LANGUAGE="JavaScript"> function resolution_finder() { var url640x480 = "http://www.yahoo.com"; var url800x600 = "http://www.googl.com"; var url1024x768 = "http://www.msn.com"; if ((screen.width == 640) && (screen.height == 480)) window.location.href= url640x480; else if ((screen.width == 800) && (screen.height == 600)) window.location.href= url800x600; else if ((screen.width == 1024) && (screen.height == 768)) window.location.href= url1024x768; else window.location.href= url640x480; } </script>
The HTML source
<center> <form> <input type=button value="Click Me And Redirect" onClick="resolution_finder()"/> </form> </center>Get visitor screen resolution using javascript,