如何实现禁止页面刷新呀

snowadrift 2004-04-01 01:40:06
我想在一程序处理其间不让用户刷新页面。不知能否实现?
否则要是用户刷新就可能出现重复提交的现象。
...全文
109 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
FRtfp 2004-04-02
  • 打赏
  • 举报
回复
学习
snowadrift 2004-04-02
  • 打赏
  • 举报
回复
??
银狐被占用 2004-04-01
  • 打赏
  • 举报
回复
学习
snowadrift 2004-04-01
  • 打赏
  • 举报
回复
看来是无法让IE即有工具条显示,又让刷新按钮不可用了呀?要能实现这个多好呀
cyl180555 2004-04-01
  • 打赏
  • 举报
回复
<script language="JavaScript">
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
oncontextmenu='return false';
}
}
if (document.layers) {
if (e.which == 3) {
oncontextmenu='return false';
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
document.oncontextmenu = new Function("return false;")
document.onmousedown=click
function keydown()
{if(event.ctrlKey ==true || event.keyCode ==93 || event.shiftKey ==true){return false;} }
document.onkeydown =keydown
</script>

这是屏蔽右键和复制、粘贴功能的代码,没有整理,不过功能没有问题,这样浏览者就几乎什么都作不了了!
cyl180555 2004-04-01
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="JavaScript">
<!--
function change()
{
var win;
win=window.open('page.asp','','width=790,height=560,directories=no,menubar=no,location=no,scrollbars=yes,resizable=no')
win.moveTo(0,0);
win.focus;
window.close();
document.write('乱码')
}
-->
</script>
</head>
<body onLoad="change()">
</body>
</html>
用上面的页面作一个中转,弹出目标页面,能屏蔽window窗口按钮。再屏蔽鼠标右键和用 eboylili(zzz)的方法屏蔽F5,这样应该差不多了吧! 试试吧!
liuyu202 2004-04-01
  • 打赏
  • 举报
回复
顶!
歪歪 2004-04-01
  • 打赏
  • 举报
回复
在页面开始和结束处都加上(不是Body标记里)
<%
Response.Buffer=true
Response.Expires=0
Response.CacheControl="no-cache"
%>  
好像是因为当页面数据量大于5M时,
<%
Response.Buffer=true
Response.Expires=0
Response.CacheControl="no-cache"
%>  
就开始停止了,所以在结尾处也要加上
snowadrift 2004-04-01
  • 打赏
  • 举报
回复
???
snowadrift 2004-04-01
  • 打赏
  • 举报
回复
??
snowadrift 2004-04-01
  • 打赏
  • 举报
回复
55555555555还是不成呀,我把我的页面一小段COPY上,请指点


<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="0">

</HEAD>

<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<%
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"

%>
eboylili 2004-04-01
  • 打赏
  • 举报
回复
静止页面缓存
htm网页
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">
或者<metahttp-equiv="expires"content="0">
asp网页
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
php网页
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");
flying310 2004-04-01
  • 打赏
  • 举报
回复
关注。
snowadrift 2004-04-01
  • 打赏
  • 举报
回复
不行呀,用 wanghr100(灰豆宝宝.net) 提供的东东
出现错误
Microsoft VBScript 编译器错误 错误 '800a0414'

调用子程序时不能使用括号

/nokia/tongzhi.asp,行141

response.addHeader("pragma","no-cache")
---------------------------------------^



用 eboylili(zzz) 提供的。
只是屏避掉了,F5键吧。要是按IE上的刷新还是可以的。
yjhgmyyamd 2004-04-01
  • 打赏
  • 举报
回复
以上的方法楼主试过没有?现在按下F5不起作用了吗?
wanghr100 2004-04-01
  • 打赏
  • 举报
回复
让网页刷新,立即失效..

HTTP:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
或者<META HTTP-EQUIV="expires" CONTENT="0">

ASP
response.expires=0
response.addHeader("pragma","no-cache")
response.addHeader("Cache-Control","no-cache, must-revalidate")
eboylili 2004-04-01
  • 打赏
  • 举报
回复
<SCRIPT LANGUAGE="JavaScript">
document.onkeydown = function() {
if(event.keyCode==116) {
event.keyCode=0;
event.returnValue = false;
}
}
document.oncontextmenu = function() {event.returnValue = false;}
</SCRIPT>
页面已经禁止刷新
qzriso 2004-04-01
  • 打赏
  • 举报
回复
没有见过,帮你up

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧