I recieved a webmaster tip via email that said you could auto detect and adjust for a person logging onto your web site. It said you had to create a directory and pages for each resolution and have your site detect the resolution of the viewer and you can automatically swith them to the correct directory for viewing. I’ve tried and can’t get the my site to switch. Any help would be appreciated. It says it can be accomplished by using a simple function in the HEAD of the code. The sample page given auto switches bu I can’t get the code of the original page to compair. Here is the code:
function newResolution() {
var url640 = “/640/index.html”;
var url800 = “/800/index.html”;
var url1024 = “/1024/index.html”;
if ((screen.width = = 640) && (screen.height == 480))
window.location.href= url640;
else if ((screen.width == 800) && (screen.height = = 600))
window.location.href= url800;
else if ((screen.width = = 1024) && (screen.height = = 768))
window.location.href= url1024;
else windo.locatio.href= url800;
}
Next, simply use onload in the BODY tag to run the function: