Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Jscript]Script timing out

Status
Not open for further replies.
Master Summoner
Joined
Oct 9, 2008
Messages
572
Reaction score
14
Heya long time no see, I'm brining a little script, that aparently doesn't work as I thought it would, it simply times out, which annoys me quite well. Heres the script:

Code:
                  if (screen.width == 1280) {
                    window.location='index.php?w=1280';
                  }
                  else if (screen.width == 1024) {
                    window.location='index.php?w=1024';
                  }
                  else if (screen.width == 800) {
                    window.location='index.php?w=800';
                  }
                  else {
                    document.write("Your screen resolution was not supported, I apologize.");
                  }

I've been trying to figgure it out, but I seems that its as easy as I thought..

Help is very much appreciated!
 
Divine Celestial
Loyal Member
Joined
Sep 13, 2008
Messages
853
Reaction score
14
I think it is:
Code:
window.location.href = 'index.php?w=1280';
 
Master Summoner
Joined
Oct 9, 2008
Messages
572
Reaction score
14
I think it is:
Code:
window.location.href = 'index.php?w=1280';

Thanks for the try, but I'm still not getting the script to work. I'm gonna try my way around this some how.
 
Master Summoner
Joined
Oct 9, 2008
Messages
572
Reaction score
14
Edit: Solved, I rewrote the script and made it a little 'better' from my point of view.
I got it here, if anyone would like to check it out:
Code:
if ((screen.width) && (screen.height)) {
   var width = 0;
   var height = 0;
   var locate = 0;
     if (screen.width == 1280) {
        width = 1280;
     }
     else if (screen.width == 1024) {
        width = 1024;
     }
     else if (screen.width == 800) {
        width = 800;
     }
     else {
        document.write('Screen width is invalid. Allowed: 1280, 1024 and 800. ');
     }
     if (screen.height == 1024) {
        height = 1024;
     }
     else if (screen.height == 768) {
        height = 768;
     }
     else if (screen.height == 600) {
        height = 600;
     }
     else {
        document.write('Screen height is invalid. Allowed: 1024, 768 and 600. ');
     }
     if (width && height != 0) {
        document.write('Your screen is ' +width + ' by ' + height + ' pixels.');
        locate = 'http://examplesite.com/setup.php?width=' + width + '?height=' + height;
        window.location= locate;
     }
     else {
        document.write('Please adjust your screen.');
     }
}
 
Last edited:
Status
Not open for further replies.
Back
Top