
关闭页面时,d出JS提示框提示是否关闭
JQUERY写法:
$(window).bind('beforeunload', function (e) {
var isEdit = '<%=FormMastPage.ViewMode%>'
if (window.is_confirm !== false &&isEdit == Enumerator.ItemViewMode.AllEdit) {
var message = '<%=this.GetRes("Msg_CheckPageEditMode")%>'
e.returnValue = message
}
})
.bind('mouseover mouseleave', function (event) {
is_confirm = event.type == 'mouseleave'
})
JAVASCRIPT写法:
window.onbeforeunload = function (event) {
var event = event || window.event
// 兼容IE8和Firefox 4之前的版本
if (event) {
event.returnValue = "确定要关闭窗口吗?"
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '确定要关闭窗口吗>现代浏览器?'
}
找到IE浏览器Internet选项里的内容进行设置
2.设置Form元素的autocomplete为“on”或者“off”来开启或者关闭自动完成功能
3.设置input输入框的autocomplete为“on”或者“off”来开启或者关闭该输入框的自动完成功能(关闭密码域的自动完成)
代码实例:
<!-- 打开自动完成功能的Form --><form name="form1" autocomplete="on">
<!-- 打开自动完成功能的输入框 -->
<input type="text" autocomplete="on" name="user">
<!-- 关闭自动完成功能的输入框 -->
<input type="password" autocomplete="off" name="password">
</form>
<!-- 关闭自动完成功能的Form -->
<form name="form1" autocomplete="off">
<!-- 打开自动完成功能的输入框 -->
<input type="text" autocomplete="on" name="user">
<!-- 关闭自动完成功能的输入框 -->
<input type="password" autocomplete="off" name="password">
</form>
表单的更多内容详见:《form表单存在的常见兼容问题》
关闭输入框的自动完成功能有3种方法:1、在IE的Internet选项菜单里的内容--自动完成里面设置
2、设置Form的autocomplete为"on"或者"off"来开启或者关闭自动完成功能
3、设置输入框的autocomplete为"on"或者"off"来开启或者关闭该输入框的自动完成功能
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)