Click here to Skip to main content
14,667,121 members
Rate this:
Please Sign up or sign in to vote.
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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100