Solved

HOw to prevent "DO you wan to close this window" in IE.

Posted on 2011-09-20
5
237 Views
Last Modified: 2012-05-12
Hi,
  I am using IE. Iam opening a pop up from index.jsp. I want to close the parent window when I open child window. When I try to close parent with self.close()..it is showing a pop up with "DO you wan to close this window". Please let me know how can I prevent it using javascript. Please find the attached code for index.jsp.


Thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head>
<script type="text/javascript" charset="utf-8">
function showLogin(){

	var strURL = "login.jsp";
	winPop = window.open(strURL,'name','height=375,width=415,left=150,top=200,toolbar=no,resizable=no,scrollbars=no');
	winPop.focus();
	self.close();

}
</script>
<body onload="showLogin()">

</body>
</html>

Open in new window

0
Comment
Question by:Sthokala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 36567895
Try this:

http://blogs.x2line.com/al/articles/350.aspx

It used to work..Not sure if it still does in the later versions of IE.
0
 

Author Comment

by:Sthokala
ID: 36567946
sorry it is not working..Please let me know how can I do it.
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 36567957
Did you try the other posts in that page or did you try the one at the top only?
0
 

Author Comment

by:Sthokala
ID: 36567993
I tried the top and below code.
<html>
<head></head>
<script type="text/javascript" charset="utf-8">
function showLogin(){

	var strURL = "login.jsp";
	winPop = window.open(strURL,'name','height=375,width=415,left=150,top=200,toolbar=no,resizable=no,scrollbars=no');
	winPop.focus();
	window.close();

}
</script>
<body onload="window.opener='';showLogin()">

</body>
</html>

Open in new window

0
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 36568104
From what I can gather it is not possible due to security restrictions in IE. As I said in my initial post, I wasn't sure if it worked in later versions of IE. To be fair, I can understand why. If I had a load of tabs open in an IE window or Firefox window and then some page closed them all for me I would be pretty narked.

This isn't possible.

Lee
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question