facebook twitter youtube
in JavaScripts - 18 Oct, 2011, This Tutorial Has Been Viewed 2,178 Times.
by admin - no comments
Find screen resolution and redirect the user using javascript
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

This script helps you to find screen resolution of a client or user and redirect to a webpage using simple

<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>
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
Find screen resolution and redirect the user using javascript, 10.0 out of 10 based on 1 rating

Incoming search terms:




coded by nessus

Leave a Reply

Close
Please support the site
By clicking any of these buttons you help our site to get better