Forum Moderators: open

Message Too Old, No Replies

how can i change close a browser window

         

laura2k

12:36 pm on May 22, 2004 (gmt 0)



hi,

i have a page that loads in a _blank target, but when this page loads i want the page that it came from to close or go to another URL

can anyone please tell me how i can do this?

thanx in advanced.

mcavill

1:12 pm on May 22, 2004 (gmt 0)

10+ Year Member



with javascript you can close the parent window using:

window.opener.close();

IE security does prompt the user if they what the window closed, or to redirect you could use:

window.opener.location = "h**p://www.google.com";

so your new page would have:

<html>
<script language="JavaScript">

function myFunction(){
//window.opener.close();
//window.opener.location = "http://www.google.com";
}
</script>

<body onLoad="JavaScript:myFunction();">

</body>

</html>

with one of the lines in myFunction uncommented