How to get the parent window url in child window

Hello, I have facing a problem in refreshing a parent window from a child window. From child window I use

opener.location.reload();

to reload the parent window and it works fine. But the problem is whenever the parent window is refershing the follwoing message come

"“The page cannot be refrshed without resending the information. click Retry to send the information again, or click cancel to reutrn to the page that you were trying to view.”

Can any tell me how to disable the message?

I also use

window.opener.location = “schedule.php?id=1”;

this also works fine. But the problem here is I need to open this child window from varius pages and for that I want make this “schedule.php” page dynamic. But I can’t get the parent window url. Is there any option to get the parent window url in child window?

Thanks in advance for helping me. :wink:

window.opener.location.href should contain the url that was called. You can only read this if its in the same domain as the window you are calling it from.

I see what you’re trying to do. The message you’re getting is because the parent window is the result of a form that was POSTED.

If you used GET, that should go away.

If GET doesn’t make it go away, then you may need to pass variables back and forth between the parent and child:

Parent:


var thisURL = "http://example.com/schedule.php?id=1";

Child:


opener.location.href = opener.thisURL;

HTH,

Jon

I was able to do this by replacing GET with POST, thanks for the suggestion.