PDA

View Full Version : Open close link



dmbware
11-08-2007, 07:15 PM
I have a main page, user clicks on a link, a new browser window opens. Now the user wants to click on link within that new window to close the window and link to a new page on the main page..

aseaofflames
11-09-2007, 02:41 AM
you could try something like this:



<script language="javascript" type="text/javascript">
<!--
function closeandrefresh(link) {
window.opener.location = link;
window.close();
}
-->
</script>


and use this as your link:

<a href="someurl.html" onclick="closeandrefresh(this.href);return false">someurl.html</a>

this should close the popup window and open the link in the original window

-aseaofflames

i haven't tested it so tell me what happens

aseaofflames
11-09-2007, 02:52 AM
double post