Forum Moderators: open
How do I rip-off the
part from a link so I can pass the URL as a parameter to an opener? a href=""
I need to open the target links from a child window on it's opener so I came out with this:
function go(url){
window.opener.location.href = url;
}
And to call it:
which would be like : onClick="go();return false" onClick="go(someURL.htm);return false"
The whole thing is a child window which holds a search form and consequent results that should that as one click, opens the target on the parent.
Also, do I have to use a function to reset the parent to
onUnload=null or thats not necessary? (I'm new to JS and got that code pieces on a site that uses the resetting). I apreciate any help, thanks
I'm not sure how you'd get into this situation in the first place though. (?)
That child window is, first, a search form then its results. Its powered by Atomz and they use proprietary tags to build the templates. In this case,
is used several times to parse each one of the target links resulted from the search. <SEARCH-LINK> ... </SEARCH-LINK>
And yes, the
code will do (goes into the <a href="blah.htm" onclick="go(this.href);return false;">
) but... now that I can open the link from child on parent, it's working only for the first link (remember? the links from search that shows on child) anything after that will open on the child, not more on parent. <SEARCH-LINK>
Would that have something to do with that
on the first post? onUnload=null
P.S. - I have ask you to be kind with my english, sorry, I know it's not very concise nor very clear but it's not my language. Portuguese if you are wondering... :)
<a href="blah.htm" onclick="go(this.href);return false;">
If the go() function is as you originally posted, I don't see any reason why the opener.location.href would not be changed with any link coded like that in the child. Should work for all links with that code.
Works fine in a test I just did.
Would you post a bit of the search result code so we can see what you have to work with?