Click to See Complete Forum and Search --> : problems with popup-window and changing the URL of it ...


KO-Tek
03-22-2003, 02:49 PM
:confused:
Hi,

I'm from Belgium and my main language is not English so I hope I will be clear enough to let you see what my problem is ... thank you for being tolerant ...

I've searched this forum to see if there's an answer to my problem but I didn't find it ...

Here's my problem :

I'm making a page that calls a popup window with window.open(...) command.

I'm trying to change the URL from this pop-upped window from within this popup-window with commands like
window.location = some relative URL or
document.location = some relative URL or
this.document.location = some relative URL and
tried several other variations ...

But none of these are working, there's nothing happening ...

Thinking it was a wrong relative URL I tried to apply this to the window.opener and this worked fine. So I think it is the command which has the problem ... or perhaps is it because it's a pop-up window ??? Are there some restrictions around changing URL's in pop-up windows ???

Here below is the javascript code from the pop-up window :

newLocation = "wishlist_popup.php?act=changeStatus&id=" + id + "&status=" + $status;

document.location = newLocation;

Can someone help me ???
Thank you in advance ...

Stephane

KO-Tek
03-22-2003, 04:26 PM
Thanks Dave for replying,

I've tried to use :

window.location = newLocation
window.location.href = newLocation

top.location = newLocation
top.location.href = newLocation

self.location = newLocation
self.location.href = newLocation

but none of these are working !!!

I guess there's something I don't understand ...
here's the URL of the page which loads up the popup window ... try to click on the coloured status bar at the end of a row ...

http://www.33rpm.be/beta/wishlist2.php?act=admin

This brings up the popup window which is used to change the coloured gif in the main window and should change the location programmatically in the popup in order to execute a PHP script and close afterwards ...

Regards
Stéphane

KO-Tek
03-22-2003, 04:44 PM
but the temp variable is used to change the image in the opener window and this seems to work ... do you mean its interferring with the window.location command ???

'cos when using the string with a "window.opener.location = newLocation" it works on the main window ... how can this be ???

S.

KO-Tek
03-22-2003, 04:52 PM
I commented the two lines using the eval string, but this seems to change nothing ... the popup window is not going to the new location ... it does nothing ...

S.

KO-Tek
03-22-2003, 05:07 PM
Does this works in your browser ???

If it is, could this be an explorer problem (I'm using a 5.0 IE) ??? I'm using this "old" explorer to test some backward compatibility ... but perhaps I should upgrade and take no care of older browsers ... what do you think about this???

S.

PS:sorry to take your time like this, but I'm nearly depressing with this issue ;)

KO-Tek
03-22-2003, 05:21 PM
Even changing the variable 'newLocation' to 'url' seems to change nothing ...

Guess this must be a IE5 bug or something like that ... 'cos the blank page you're talking about is the right result I'm looking for (the PHP script reacting to this is not written yet, 'cos I get stucked before ... sometimes I'm hard-headed and thought this would be working fine ... I'm allready 8 hours on this part ...)

Really strange behaviour isn't it ??? Is there an alternative to achieve the same result ??

S.

KO-Tek
03-22-2003, 05:53 PM
So,

I finally decided to upgrade IE and everything seems to work fine ...

Even if this problem is not really solved, I'll write a browser-detection routine which warns the user about IE5 problems ...

I really want to thank you for all this time spending with me around this issue ... this forum rocks ...

Stéphane