If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Javascript Redirect - Please Read, Complicated Task

Hello, ok here is the scenereo I have created a popup to load an offsite game into it. And when they register to play the game it loads there homepage, which is fine but what I need to do is for it to redirect them back to the origonal popup. Let me give you some links so you can test it for yourself so you get a better understanding

Now when you goto register to play the game
(please test this its free registration) it takes you to there homepage after you go through the registration process you can even enter false information it dont matter. This all still done inside the popup window on my site.

It takes you to there homepage which is http://www.battleon.com what I am trying to do is I thought If i added an iframe with like 1 width and height and placed a code in there that was something like:

Create a new html page that would open in the popup when you clicked the game link. Inside that page create an iframe and have the external site load in that iframe. You could get away with using a width and height of 100% for the iframe since you don't really need the space for anything else. Then add the code below to the page that contains the iframe.

That should check the frame url everytime it loads a new page. If it finds a match then it redirects back to your page. You may have to tweak it a bit, such as changing the frames[] index number or adding the parent.frames[] to the window.location. But I'm pretty sure it should work.

If it doesn't work, you may have to use the old fashion way for creating frames. Create a page containing a frameset tag and name each frame src. Then create a separate file for the first frame src that includes the function listed above. And set the src of the second frame to the external site url.