try
onunload=[expression]
event
onunload=[expression]
event
解决方案 »
- 求教!!!即时变更input后面内容!!
- 大家快来帮帮我,请问在js里能否获得触发onbeforeunload事件的控件ID?
- 一个js问题
- 我用iframe载入了一个网站。。我想得到当前iframe请求页面的地址。如何取得?
- 163邮箱添加文件夹或者删除邮件时的那个浮动窗口时怎样实现的呢?
- javascript怎样让任务栏中的IE窗口按钮闪烁?
- 史上最牛逼的特效,能搞定的都不是一般人!!!!!
- 求一个js,怎么样通过js让select展示下拉框
- 我的问题还没有解决~!
- js稳妥模式?
- 在一个包含2个框架的页面中怎么实现把鼠标停在2个框架交界处的时候鼠标边为拉伸的图形?
- 紧急求助,关于层控制问题。
<body onbeforeunload="...aspx?paras=12333333";>
<html>
<head>
<title>PostDataToOtherPage</title>
<script>
function postdata(mydata)
{
window.open("OtherPage.htm?" + encodeURI(mydata));//把数据编码后,弹出新页面,把数据传递过去
//window.open("OtherPage.asp?mydata=" + encodeURI(mydata));//如果是传递到asp或php等页面,得到传递过来的数据就太容易了。我就不详述了。
}
</script>
</head><body onunload="postdata('Are you OK?');">
请关闭页面!
</body>
</html>如果是传递到静态页面,用decodeURI(location.search.substr(1))得到传递过来的参数并解码:<html>
<head>
<title>接受提交演示</title>
</head><body><SCRIPT lanaguage="javascript">
var mydata = decodeURI(location.search.substr(1));
document.write(mydata);
</SCRIPT>
</body>
</html>