<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[js关闭浏览器窗口或离开页面时]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[搜索优化]]></category>
<pubDate>Mon, 16 Oct 2006 03:10:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	注：三大主流浏览器中firefox和IE都支持onbeforeunload事件,opera尚未支持。<br/><br/>用法：<br/><br/>object.onbeforeunload = handler &lt;element onbeforeunload = “handler” … &gt;&lt;/element&gt; 描述：<br/>事件触发的时候弹出一个有确定和取消的对话框，确定则离开页面，取消则继续待在本页。<br/>handler可以设一个返回值作为该对话框的显示文本。<br/><br/>触发于：<br/><br/>关闭浏览器窗口 通过地址栏或收藏夹前往其他页面的时候 点击返回，前进，刷新，主页其中一个的时候 点击 一个前往其他页面的url连接的时候 调用以下任意一个事件的时候：click，document write，document open，document close，window close ，window navigate ，window NavigateAndFind,location replace,location reload,form submit. 当用window open打开一个页面，并把本页的window的名字传给要打开的页面的时候。 重新赋予location.href的值的时候。 通过input type=”submit”按钮提交一个具有指定action的表单的时候。 可以用在以下元素：<br/>BODY, FRAMESET, window<br/><br/>平台支持：<br/>IE4+/Win, Mozilla 1.7a+, Netscape 7.2+, Firefox0.9+&gt;<br/><br/>示例代码点:<br/><br/><br/>&lt;body onbeforeunload=&quot;RunOnBeforeUnload()&quot;&gt;<br/>&lt;script&gt;<br/>function RunOnBeforeUnload(){<br/>if (confirm(&quot;Exit?&quot;)==true){<br/>alert(&quot;Exit&quot;);<br/>}else{<br/>alert(&quot;no exit&quot;);<br/>return false;}<br/>}<br/>&lt;/script&gt;<br/>&lt;/body&gt;<br/><br/><br/><br/>Tags - <a href="http://www.dzhope.com/tags/%25E5%2585%25B3%25E9%2597%25AD%25E9%25A1%25B5%25E9%259D%25A2/" rel="tag">关闭页面</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] js关闭浏览器窗口或离开页面时]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>