Forum Moderators: open
Thanks.
<script type="text/javascript">
function openParent (url) {
if (window.opener &&!window.opener.closed){
window.opener.location = url;
window.close();
}
}
</script>
Then your links:
<a href="/search_result.html" onclick="openParent(this.href)">
Added: that was quick jatar_k!
[edited by: Birdman at 5:44 pm (utc) on Feb. 26, 2007]
I have another link that I was trying to incorporate what you have into it, but on IE an alert box pops up asking if I want to close the window, and on FF nothing happens. What's wrong.
Here's what I have:
<? $tester = "http://google.com";?>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function popNewWindow() {
window.open("<?echo $tester;?>", "popup",
"width=800,height=600,scrollbars=no,menubar=no"
);
window.close();
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<A href onclick="javascript:popNewWindow();">Open new window!"</A>
</BODY>
</HTML>
Also I would prefer the url to be in the href code instead of in the javascript like yours; but I can't get it like that. And a simple way to maximize the window instead of putting width and length.