JS捕获页面刷新,JS刷新父页面
2016-11-09 11:38
155 查看
JS刷新父页面
十一种刷新按钮的方法。很不错的,经常上网要找。哈哈。这下放这里了。
<input type=button value=刷新 onclick="history.go(0)">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<form action="自身的文件">
<input type=submit value=刷新>
</form>
<a id=a1 href="自身的文件"></a>
<input type=button value=刷新 onclick="a1.click()">
JS捕获刷新
window.onbeforeunload = function()
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
alert("是关闭而非刷新");
window.event.returnValue = "";
}else
{
alert("是刷新而非关闭");
}
}
十一种刷新按钮的方法。很不错的,经常上网要找。哈哈。这下放这里了。
<input type=button value=刷新 onclick="history.go(0)">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<form action="自身的文件">
<input type=submit value=刷新>
</form>
<a id=a1 href="自身的文件"></a>
<input type=button value=刷新 onclick="a1.click()">
JS捕获刷新
window.onbeforeunload = function()
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
alert("是关闭而非刷新");
window.event.returnValue = "";
}else
{
alert("是刷新而非关闭");
}
}
相关文章推荐
- 【web前端】js刷新父页面:JS用什么方法可以在弹出的子页面刷新父页面?
- js 捕获浏览器关闭或者刷新页面给出提示
- 避免页面刷新后置顶的js
- ASP.net下的前台日历控件源代码(不刷新页面)Calendar .js
- 偷来的js 判断用户关闭浏览器或者刷新页面 ie有效
- js刷新父页面
- Asp.Net js捕获页面中获得焦点的控件
- 刷新页面实现方式总结(HTML,ASP,JS)
- JS前台验证老刷新页面
- js11种刷新页面的方法
- 输出js及时刷新页面
- js刷新父页面
- js页面自动刷新,并显示剩余时间
- 几种页面刷新常用代码(js)
- 利用php和js实现页面数据刷新
- 页面无刷新调用数据(IFRAME+js)
- 判断页面是关闭还是刷新的js代码
- js刷新页面问题
- JS页面刷新
- js计时器实现页面刷新和幻灯片效果