Jump to content
  • Advertisement
Sign in to follow this  
31337

[web] Javascript Question

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I hate to post this kind of thing here, but I've exausted all options. I am trying to make a child window change the location of it's parent window and then check to make sure that the parent window loaded: A) An existant page, B) Not a 0 Kilobyte Page. All of the pages the parent window should be loading have the same title, so I figure I could check the title. My current function looks a bit like this: function load(theform) { window.opener.location.href = blah; while(window.opener.document.readyState!="complete") { } if(window.opener.document.title!="Title of Pages") { window.opener.location.href = UrlOfDENIEDPage; } } Problem with this is that it messes up browsers pretty bad because of the while loop. Is there any alternative? How do I do this? It would be easier if I could just check a URL to see if it existed and how large it was via scripting before I sent the parent window to it. Thanks a bunch

Share this post


Link to post
Share on other sites
Advertisement
Exhausted all options, except the forum designed for this sort of question - Web Development. :P I'll move this over.

(Hint: try using setTimeOut to poll the readystate every so often instead of the while loop?)

Share this post


Link to post
Share on other sites
The proper forum for this post is ambiguous. I would rather not use a time-based approach.

Share this post


Link to post
Share on other sites
Quote:
Original post by 31337
The proper forum for this post is ambiguous. I would rather not use a time-based approach.


Isn't there an "onreadystatechange" event handler? I think it's IE only, though. Eitherway, a time-based apporach is infinitely better than this loop you have here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!