What you just saw was a result of the execution of
a small script written in JavaScript. It illustrats how to detect the screen
resolution the site visitor is using and then direct him/her to the correct
version of your website based on this resolution.
Here is the JavaScript code:
/*
This detects the screen resolution with screen.width, and uses switch
to call goToPage() depending on the screen width. If the screen resolution
detected does not match any in the case statements, the default statement
will direct them to the 'safest' page. You can add or remove case statements,
and of course change the URLs they point to.
*/
switch(screen.width)
{
case 640: goToPage('640x480.htm'); break;
case 720: goToPage('720x480.htm'); break;
case 800: goToPage('800x600.htm'); break;
case 848: goToPage('848x480.htm'); break;
case 1024: goToPage('1024x768.htm'); break;
case 1152: goToPage('1152x864.htm'); break;
case 1280: goToPage('1280x1024.htm'); break;
case 1600: goToPage('1600x1200.htm'); break;
default : goToPage('800x600.htm'); break;
}
/*
This function simply takes the user to the page passed to it. For this page,
the action has been disabled by commenting it out to allow you to read this
page, and an alert() has been put in to demonstrate that it works.
*/
function goToPage(url)
{
//window.location.replace(url);
alert('You would now be forwarded to ' + url + ' ');
}