window.onbeforeunload = remove;function remove()
{
KfUtil.test();//此处dwr调用后台代码,没有执行
}被充说明:
window.onunload = remove;也不行。 我想是因为还没有执行到页面就关了吧,估计是这样。
请大家看看是什么原因,该怎么解决啊..
解决方案 »
- 浏览器内的javascript脚本怎么调用本地的linux命令
- mxgraph如何使用
- 散分..帮我测试下JS这段代码
- 高分请教一个超简单的无限制滚动问题
- 如何实现图片循环流动播放?
- microsoft MSN注册页面检查密码强度JS源代码,大家都来顶顶,研讨研讨(用算法写的)接着
- 求正则表达式写法
- **如何使页面上的某个区域或页面上图片的某个区域显示红色或加亮!!!!--分不够可再加!!!
- 如何让一个textbox变灰色?
- ajaxSubmit IE file标签同步的问题
- 强分大难题 ,js 脚本模拟 enter键 操作 alert() 弹出框
- 几行css代码,为何在ie中,margin在border之内,可以其他几个浏览器,margin都在border之外呢?(有代码)
ExampleThis example uses the onbeforeunload event to ask users whether they want to remain on the current page or navigate to a new URL. When the user clicks on the hyperlink or attempts to close the browser window, the onbeforeunload event fires on the body and a dialog box appears. If the user chooses 'OK', the page navigates to the new URL (www.microsoft.com) or closes the window; if the user chooses 'Cancel', the page remains the same.HideExample<HTML>
<HEAD>
<SCRIPT>
function closeIt()
{
event.returnValue = "Any string value here forces a dialog box to \
appear before closing the window.";
//window.onbeforeunload="closeIt()";
}
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
<a href="http://www.microsoft.com">Click here to navigate to
www.microsoft.com</a>
</BODY>
</HTML>
看看这骗文章
http://liaijun82-live-cn.javaeye.com/blog/342978
function remove()
{
alert("remove...");
KfUtil.test();//此处dwr调用后台代码,没有执行
}
此处执行了。
KfUtil.test();
没有执行。。