function cancelEvent(evt){ if (window.event) { window.event.cancelBubble =true; }else{ evt.stopPropagation(); } } event在firefox浏览器中是局部变量,所以必须要通过参数的方式传递到相应的方法中。