Hey All! I’m designing a webpage and I want javascript to detect the users screen resolution (800×600 etc…) and then redirect them to the page that will suit their resolution (e.g. 800×600.html or 1024×768.html etc…). Here’s what I have, but it doesn’t work.
[code=php] <SCRIPT type=”text/JavaScript”>
if ((screen.width>=800) && (screen.height>=600))
{
document.writeln(‘<link rel=”html” type=”text/html” src=”800×600.html” />’);
}
if ((screen.width>=1024) && (screen.height>=768))
{
document.writeln(‘<link rel=”html” type=”text/html” src=”1024×768.html” />’);
{
else
{
document.writeln(‘<link rel=”html” type=”text/html” src=”800×600.html” />’);
}
</SCRIPT>
I put it in the head + body but it didn’t work. If you don’t understand what I’m trying to do please let me know.