js 退格监听 ifream...
时间:2010-08-15 来源:assureo
try { document.frames[name].document.documentElement.onkeydown = function(evt){ //var b = !!evt, oEvent = evt || window.event; var b = !!evt, oEvent = evt || this.ownerDocument.parentWindow.event; if (oEvent.keyCode == 8) { var node = b ? oEvent.target : oEvent.srcElement; var reg = /^(input|textarea)$/i, regType = /^(text|textarea)$/i; if (!reg.test(node.nodeName) || !regType.test(node.type) || node.readOnly || node.disabled) { if (b) { oEvent.stopPropagation(); } else { oEvent.cancelBubble = true; oEvent.keyCode = 0; oEvent.returnValue = false; } } } } } catch(ex) {}
相关阅读 更多 +