Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi ,

I have been facing a problem for last six months, still i didnt find the solution,i want to close the opened popup window in IE by using java script code

Please help me.I will appreciate you.
Posted
Comments
Karthik_Mahalingam 15-Jan-14 7:52am    
why cant you post before 6 months?? when it actually occurred.
which code you are using to close it ?
window.close() ??

post your code...
argeraju 15-Jan-14 9:42am    
Actually on that task some other developer was working, he didnt solve that,team leader assigned to me..

I m using
window.close(); function only,it is working fine in firefox browser but not in IE
Sampath Lokuge 15-Jan-14 8:01am    
Check this link : http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_close2
argeraju 16-Jan-14 11:10am    
Hi sampath , it didnt work for me..
What code you have tried?

Use Google.
Closing a window[^]
 
Share this answer
 
Comments
argeraju 15-Jan-14 9:45am    
I have tried to close window by using window.close()
but it didnt work for me in IE browser.

Requirement is something like this:
After login into the application end user can open any number of windows but when he log out the application all opened windows should be close.
Based on your comments,
this will help you i guess close-child-window-when-parent-window-is-closed-using-JavaScript-in aspx[^]
 
Share this answer
 
v2
Comments
argeraju 23-Apr-14 14:21pm    
Actually window contains the report data in the pdf format. They are not normal aspx page windows, they are pdf windows.
In FIrefox when i can able to close them using window.close but not in IE.
you can create a array that will store the object of all the windows your end user is creating. Once he hit the logout button use that array to close all the windows.
 
Share this answer
 
Comments
argeraju 23-Apr-14 14:21pm    
Actually window contains the report data in the pdf format. They are not normal aspx page windows, they are pdf windows.
In FIrefox when i can able to close them using window.close but not in IE.
C#
function ApplyValues() {


         var o = new Object();

         o.companyname = document.getElementById("company").value;
         o.address = document.getElementById("address").value;
         o.city = document.getElementById("city").value;
         o.state = document.getElementById("state").value;
         o.country = document.getElementById("country").value;
         o.phone = document.getElementById("phone").value;
         o.email = document.getElementById("email").value;
         o.firstName = document.getElementById("firstName").value;

        window.returnValue = o;
        window.close();
}

 <table><tbody><tr><td width="198" bgcolor="#DBDBDB"><a href="#" onclick="javascript:return ApplyValues()" class="menuItem">Apply</a><br>

</br></td></tr></tbody></table>
 
Share this answer
 
Comments
argeraju 23-Apr-14 14:21pm    
Actually window contains the report data in the pdf format. They are not normal aspx page windows, they are pdf windows.
In FIrefox when i can able to close them using window.close but not in IE.

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