Wyld
12-04-2003, 08:16 PM
Hey guys,
I need help for this script. I'm building a web site and this web site is available in two resolutions: 800*600 and 1024*768.
1.On the main page (index.html), the script detect the screen resolution.
2.If the screen width is 800, I want to redirect to http://www.golfdumoulin.ca/page.html
3.If the screen width is 1024, I want to redirect to http://www.golfdumoulin.ca/pageA.html
4.Other, I want to stay in index.html and "The web site doesn't support your screen resolution" should appear.
5.When I refresh my web page.... the script seems to work.... but it always redirect me to
http://www.golfdumoulin.ca/pageA.html except if I am in any other screen resolution than 800*600 or 1024*768. So, the last part of the script works....
I don't know what's going on.....
Can u help me?
Sorry if my english isn't perfect.
-Frank.
<script language="JavaScript1.2">
<!--
var correctwidth1=800;
var correctwidth2=1024;
if (screen.width==correctwidth1)
{
function redirect()
{
window.location = "http://www.golfdumoulin.ca/page.html"
}
setTimeout("redirect();", 3000)
}
else if (screen.width==correctwidth2)
{
function redirect()
{
window.location = "http://www.golfdumoulin.ca/pageA.html"
}
setTimeout("redirect();", 3000)
}
else
{
document.write("The web site doesn't support your screen resolution")
}
//-->
</script>
I need help for this script. I'm building a web site and this web site is available in two resolutions: 800*600 and 1024*768.
1.On the main page (index.html), the script detect the screen resolution.
2.If the screen width is 800, I want to redirect to http://www.golfdumoulin.ca/page.html
3.If the screen width is 1024, I want to redirect to http://www.golfdumoulin.ca/pageA.html
4.Other, I want to stay in index.html and "The web site doesn't support your screen resolution" should appear.
5.When I refresh my web page.... the script seems to work.... but it always redirect me to
http://www.golfdumoulin.ca/pageA.html except if I am in any other screen resolution than 800*600 or 1024*768. So, the last part of the script works....
I don't know what's going on.....
Can u help me?
Sorry if my english isn't perfect.
-Frank.
<script language="JavaScript1.2">
<!--
var correctwidth1=800;
var correctwidth2=1024;
if (screen.width==correctwidth1)
{
function redirect()
{
window.location = "http://www.golfdumoulin.ca/page.html"
}
setTimeout("redirect();", 3000)
}
else if (screen.width==correctwidth2)
{
function redirect()
{
window.location = "http://www.golfdumoulin.ca/pageA.html"
}
setTimeout("redirect();", 3000)
}
else
{
document.write("The web site doesn't support your screen resolution")
}
//-->
</script>