Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Nov 2007
Posts: 19
Reputation: smilyswapna10 is an unknown quantity at this point 
Solved Threads: 0
smilyswapna10 smilyswapna10 is offline Offline
Newbie Poster

Problem with IE7

 
0
  #1
Feb 14th, 2008
Hi,

I am working on the IE7 bowser. when i close(exit) the browser. i want to need a conformation.
I have written the below code but its working in IE6 only.

code :


<html>
<head>
<script type="text/javascript">
window.onbeforeunload=function(){

if (window.event.clientY < 0 && (window.event.clientX > (document.documentElement.clientWidth - 5) || window.event.clientX < 15) ) {
alert("closing window");
}

}
</script>
</head>
<body>
test
</body>
</html>

pls help me out
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 514
Reputation: techniner is an unknown quantity at this point 
Solved Threads: 19
techniner techniner is offline Offline
Posting Pro

Re: Problem with IE7

 
0
  #2
Feb 14th, 2008
Give tis a shot:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. //Response.Write("<script>javascript:var w = window.open('clickonce.application','_blank');
  2. w.opener=null;
  3. w.open('','_self');
  4. w.close();
  5. window.open('','_self');
  6. window.opener=null;
  7. window.close();</script>");
  8.  
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 154
Reputation: katarey is an unknown quantity at this point 
Solved Threads: 20
katarey's Avatar
katarey katarey is offline Offline
Junior Poster

Re: Problem with IE7

 
0
  #3
Feb 14th, 2008
This Code may help you

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script type="text/javascript">
  2. window.onbeforeunload = function (evt) {
  3. var message = 'Are you sure you want to leave?';
  4. if (typeof evt == 'undefined') {
  5. evt = window.event;
  6. }
  7. if (evt) {
  8. evt.returnValue = message;
  9. }
  10. return message;
  11. }
  12. </script>
Freelance Web Designer & Developer
Http//www.Katarey.com
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 19
Reputation: smilyswapna10 is an unknown quantity at this point 
Solved Threads: 0
smilyswapna10 smilyswapna10 is offline Offline
Newbie Poster

Re: Problem with IE7

 
0
  #4
Feb 15th, 2008
hi,

sorry urs code is not working.

I am using IE7 browser. Actually my requirement is if i close(X) the browser then i want to get the conformation same as when i closing the tabs also i want to get the conformation and same as when i close the tabs from the task bar also i need a conformation.

I have written the code but its working only when i close(x) button. i need that two aslo

code :


<html>
<script language="javascript">
window.onbeforeunload = function() //author: meizz
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
window.event.returnValue = "";
alert('close');
}
}
</script>
please help me out.

Thanks in advance.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC