//禁止網(wǎng)頁后退
window.history.forward(1);
document.attachEvent("onkeydown",docKeyDown);
function docKeyDown() {
//屏蔽退格刪除鍵
if (window.event.keyCode == 8) {
if(window.event.srcElement.type != "text"
&& window.event.srcElement.type != "textarea"
&& window.event.srcElement.type != "password") {
window.event.keyCode = 0x0;
return false;
} else if(window.event.srcElement.readOnly) {
window.event.keyCode = 0x0;
return false;
}
}
}
//加載進(jìn)度條
var process_submit_doing = false;
try {
window.attachEvent("onload",doBodyLoad);
//document.attachEvent("onclick",doProcess);
window.attachEvent("onbeforeunload",doWinLoad);
} catch(e) {
document.addEventListener("onclick",doProcess,false);
window.addEventListener("onbeforeunload",doWinLoad,false);
}
//
function doBodyLoad() {
var obj;
var vInput=document.getElementsByTagName("INPUT");
for(var i in vInput) {
obj=vInput[i];
if(obj.type=="button" || obj.type=="submit") {
obj.attachEvent("onclick",doProcess);
}
}
vInput=document.getElementsByTagName("IMG");
for(var i in vInput) {
obj=vInput[i];
if(undefined != obj.alt) {
obj.attachEvent("onclick",doProcess);
}
}
}
//
function doWinLoad() {
process_submit_doing = true;
}
//
function doProcess() {
//是否正在提交
if(!process_submit_doing) {
return;
}
//
var showProcess = false;
//捕獲事件源
var eventObj = event.srcElement;
var btnvalue = "";
if(eventObj.tagName=='INPUT') {
btnvalue = eventObj.value;
} else if(eventObj.tagName=='IMG') {
if(null != eventObj.alt && "" != eventObj.alt) {
btnvalue = eventObj.alt;
} else {
btnvalue = eventObj.title;
}
}
btnvalue = btnvalue.replace(/ */g,"").replace(/ */g,"");
//
var my_array = new Array();
my_array.unshift("提交", "確定", "保存", "暫存", "結(jié)賬", "審核", "審批", "作廢", "回退", "退回", "駁回",
"退單", "撤消", "導(dǎo)入", "受理", "辦理", "處理", "查詢", "入庫", "入賬", "出庫", "出賬");
for (i = 0; i < my_array.length; i++) {
if(new RegExp(my_array[i],"ig").test(btnvalue)) {
showProcess = true;
break;
}
}
//alert(showProcess);
//不顯示進(jìn)度條
if(!showProcess) {
return;
}
//
createProcessBgDiv();
}
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick()
{
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
//頁面蒙版
function createProcessBgDiv()
{
var h=document.body.scrollHeight;
var w=document.body.scrollWidth;
var div=document.createElement("");
//div.appendChild(document.createTextNode("xxxxxxxxxxxxxxxxxxxx"));
div.appendChild(document.createElement(""));
document.body.appendChild(div);
document.body.appendChild(document.createElement(""));
//屏蔽鼠標(biāo)右鍵
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
}
/*function delProcessBgDiv()
{
document.body.removeChild(document.getElementById("divProcessBg"));
document.onmousedown = null;
} */
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com