Click here to Skip to main content
15,894,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

I have requirement to close popup window, scenario of my requirement is this one page parent.html consist no. of link for e.g.sampleFile.pdf,sampleFile.doc,etc(all file on server) now when i click on this sampleFile.pdf it should open popup window(which is working fine)and display pdf file in popup window,but when i click sampleFile.doc it should open from client side in Microsoft Word(work fine) but problem is that Popup window remain open till close manually but it should get closed when click on doc link,how it is to be done using javascript ?


Thanks in Advance
any help would be appreciated
Saffuraj
Posted

1 solution

You would need to maintain a collection of the popup windows you open, assuming you are using window.open. Then add a client-side click event handler to each link that closes all of the open windows before allowing the default action to proceed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900