Hello,
My WEB site opens an application window and then, from its original window it navigates to a status page.
Code:
[CODE]var newWindow
function popUpApplication() {
newWindow = window.open(url, parameters…);
window.location.href = statuspage.jsp;
}
Now I would like to have access to the application window handle from statusPage.jsp, is it possible and if yes then, how is it done?
On a separate thread that I marked as resolved a bit to early WolfShade suggested:
[QUOTE]
Untested:
Code:
[CODE]var newWindow
function popUpApplication() {
newWindow = window.open(url, parameters…);
window.location.href = “statuspage.jsp?window=newWindow”;
}
Then in statuspage.jsp..
Code:
[CODE]var windowHandler;
thisURL = document.URL;
thisURLarray = thisURL.split(“?”);
thisQS = thisURLarray[1];// Everything after the ‘?’
thisParam = thisQS.split(“=”);
windowHandler = thisParam[1];
.. and then whatever you do would have to be in an eval(), unless someone can figure out a better way to execute.
The problem of this solution is that the parameter received from the URL is the string “[object]” that can not be evaluated to anything usefull.
Another idea by “rnd me” was that:
[QUOTE]
if you call window.open twice on different pages upon the same site, passing identical an identical ID as argument2 each time, you can re-use the popup.
the other way is to set window.name to the name of the popup.
window.name survives refreshes/page changes, so it’s like url params but without the splitting headache.
Now the problem with this solution is that if the window was closed by the user I will end up with a new pop up window, which I would like to avoid… Unless there is a way to check for window existence prior to attempting to create a new window.
Any other suggestion, code fix for the previous ones?
Thanks all