1) CODE TITLE: Improved Screen resolution detection and notification Script

2) AUTHOR NAME/NOTES: Dynamic Drive as Original, Peter Slater for improved script

3) DESCRIPTION:

This is an improved script that Dynamic drive put up. It is a simple script which your viewers screen resolution is checked against a set resolution (default set as 800 by 600). All you need to do is paste the code into your BODY section and the code will display lines as seen above on your web page. Feel free to change the script so it provides an alert instead (but make sure you change the <br> html to \n for the new lines to work. It is also possible to name the script as a function and use the Body Onload feature to call the function (which means you would need to store the javascript in the head section or in an external file).

4) ATTACHED BELOW

Code:
<script language="JavaScript1.2">
<!--

/*
Screen resolution detection and notification Script- 
© Peter Slater (original source by DynamicDrive)
I edited it to fix an issue with their script
If using 'alert' instead of 'document.write', remember to change the '<br>' to '\n' for the new line
Feel free to name the script as a function and call it using the body onload feature
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var correctwidth=800;
var correctheight=600;
if(screen.width>=correctwidth&&screen.height>=correctheight) 
document.write("This web site is bested viewed with a screen resolution of "+correctwidth+"*"+correctheight+".<br>Your current resolution is "+screen.width+"*"+screen.height+".<br>You do not need to change your settings.");
else
document.write("This web site is bested viewed with a screen resolution of "+correctwidth+"*"+correctheight+".<br>Your current resolution is "+screen.width+"*"+screen.height+".<br>It is recommended you change your screen resolution to "+correctwidth+"*"+correctheight+".");
//-->
</script>
Pete