Ad Code

Get Monitor Screen Resolution with Javascript

Your current screen resolution (if you have javascript enabled) is

To display a visitor's screen resolution, simple include the following code in your page:

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

Screen resolution redirect

Once you know what a visitor's screen resolution is, you can redirect them to a particular page. Admittedly, you'd be better off with a page that worked at any screen resolution, but anyhow ;)

The script below will redirect users based on whether or not they have a monitor resolution of 800x600 or below:

1
2
3
4
5
6
7
8
<script type="text/javascript">
if ((screen.width<=800) && (screen.height<=600)) {
}
else {
}
</script>

Post a Comment

0 Comments