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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>window.close()???????</b>

Status
Not open for further replies.

Huitzilopochtli

Programmer
Feb 18, 2002
81
0
0
DE
Hi

This script seems to work when I want to go back to my home page (from a pop-up window):

<script language=&quot;JavaScript&quot;>
function open_main(page) {
window_handle = window.open(page,'main');
return false;
}
</script>

<a href=&quot;index.html&quot; onClick=&quot;return open_main('index.html')&quot;>home</a>

but it leaves the pop-up window still open. Do I just insert window.close() after the onClick?? Can't seem to get it to work.

Secondly, the page which generated the pop-up window is also still open. How would I close that at the same time as closing the pop-up?

Cheers for any ideas!

Huitzil

 
self.close onunload should close it.

as for the seccond question without some server intervention I really can't think of a way to dynamicaly close two windows at the same time.

possibly someone has something up their sleeve Just a suggestion: faq183-874
admin@onpntwebdesigns.com
 
Hi Onpnt

Many thanks for your help.

I'll try onunload.

The links I'm grateful for and have saved them - it's bedtime here.

Best wishes

Huitzil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top