...

View Full Version : complicated looping and redirecting..just complicated



kaptin
09-06-2006, 04:03 AM
im gonna try and explain this as best as i can
here goes

basically i have my main page, this page is where users fill out a form using document.myForm.submit()

I am trying to submit this information serveral times, in a timed loop using setTimeout()

NOW! the post goes to an outside website which spawns a 2ndWindow(this second window is a different website, i do not have access to the code 2ndWindow). This window must be open to complete the task at hand.

the problem lys here.... this 2ndWindow that opens contains this code

function redirectParentFast(){
window.opener.location='http://url.com';
}

that code is executed on the 2ndWindow, and my mainScript window is redirected, therefore kicking it out of the loop the first time it goes though.

im not real sure on how to correct this problem....
any ideas?

_Aerospace_Eng_
09-06-2006, 06:40 AM
If you have no access to the 2nd page then there is nothing you can do as javascript cannot go across domains.

kaptin
09-06-2006, 09:23 AM
tell i was thinking this maybe?
u some how have the info that u collect for the post
send that information to another window u have created and then have that other window post it to the web page, that way when the page2 doest the window.opener.location **** it only effects the extra TEMP page
Leaving ur main script alone

..>
would that work?

_Aerospace_Eng_
09-06-2006, 06:52 PM
You would probably still get an access denied error and your script will stop.

Basscyst
09-06-2006, 10:53 PM
tell i was thinking this maybe?
u some how have the info that u collect for the post
send that information to another window u have created and then have that other window post it to the web page, that way when the page2 doest the window.opener.location **** it only effects the extra TEMP page
Leaving ur main script alone

..>
would that work?

That should work actually. Just spawn a window to open the 2ndwindow. The script is redirecting on the opener in this case being the temp, which shouldn't be a problem since it seemed to work just fine for the main page. The script on the main page will just have to redirect the temp window to the page that opens the 2ndwindow at each loop, since it will be redirected when the 2nd window opens.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum