document.oncontextmenu=function(ev){var e = ev || window.event;if(e.preventDefault){
e.preventDefault();}else{
e.returnValue =false;//return false也可以阻止默认事件但是适合后面没有其他逻辑代码,否则会终止函数执行}}
阻止事件冒泡的兼容问题
document.onclick=function(ev){var e = ev || window.event;if(e.stopPropagation){
e.stopPropagation();}else{
e.cancelBubble =true;}}