Jump to content

[SOLVED] Problem with resolution script!


budimir

Recommended Posts

Hey guys,

 

Why isn't this script working? It's a script for redirecting to antoher file depending on the resoultion. But when I load a file it just does nothing.

 

<SCRIPT language="JavaScript">
<!--
if ((screen.width >= 1024) && (screen.height >= 768)) {
window.location="index.php";
} else {
window.location="index_glavni_m.php";
}
//-->
</SCRIPT>

 

Help, please!!!!!

Link to comment
Share on other sites

Scratch that. I tried it on this end by substituting google into the first and phpfreaks into the second and it was the same thing. It wouldn't even redirect without the if statements though. Not sure. JS is enabled here so I'm not sure. The syntax is right as far as i know.

 

*edit* does that mean if they have a large screen size it recursively calls itself? The page loads, runs the script, redirects to the page, runs the script....

 

Link to comment
Share on other sites

OK,

 

I think I get where is the problem.

 

The script can't be in the same file from which I'm calling the redirect. I need to take it to another file, than it's working.

 

So, it would be.

 

Index.php -> resolution.php -> index_h.php or index_l.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.