Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating URL of parent window 1

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
US
Hi,
I have a page that has a link that opens a new browser window when clicked. That new borwser window also has links. When one of the links is clicked I need the parents's page URL to be changed (child page shoudl pass it a different query strign parameter based on which link is clicked on child page).
How can this be done with onclick event in the child page? Basically what is the way to update URL on parent page from child page

thanks
 
Hi

Basically it is not parent. Is opener.
Code:
[gray]<!-- ... -->[/gray]

<a href="#" onclick="opener.location.search='?param=value';return false">Open link in my opener</a>

[gray]<!-- ... -->[/gray]

Feherke.
 
Feherke,
I tried this and ran into an issue:
If for example the parent window has the present URL of
after I call
opener.location.search='?id=5' or even
opener.location.search='program.aspx?id=5

the parent window tries to open


So for some reason it concatenates page name and query string parameters to the existing page name. It happens even if I do not pass the page name, like such:
opener.location.search='?id=5'

Do you knwo what could be causing this?

thanks
 
Dan,
thanks, I will give it a try. Does return false; matter?

what does that do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top