您的位置:首页 > 其它

电脑怎样限制装软件 怎么限制软件运行

2008-10-30 02:58 344 查看
为了防止用户刷屏重复提交,有的时候会让人很头痛。
解决方法有:struts的令牌。。。还其他的么,不知道了。

而我现在忽然想起了一个方法就是通过JS也解决问题。。经过多方测试,自我感觉良好。

解决方案:

如果在某一个action中,需要作这个防刷功能,那么我会在用户提交时,
1、给页面加上<frame>标签
<iFrame id="slipFrame" name="slipFrame" src="about:blank" width="100%" height=0 marginwidth=″0″ marginheight=″0″ frameborder="0" scrolling="no" space="0" vspace="0"></iframe>

2、给FORM加上TARGET指向<frame>;
document.addCompositRule.action = "systemEditCompositRuleCondition.do?actions=update";
document.addCompositRule.target = "slipFrame";
document.addCompositRule.submit();
event.srcElement.disabled = true;

3、提交。
4、提交后用JS调父窗体刷新
//成功或失败:回调方法
function sucessCallback(){
refreshRule();
}


function doPost() {
//System.out.println("errorMsg:"+"="+<c:out value="${errorMsg}"/>);
alert("操作成功!");
if( opener != null ) {
opener.sucessCallback();
window.close();
} else if( parent != null ) {
parent.sucessCallback();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: