JavaScript中的mozilla的window.event.clientX的等價性是什麼? 這是我的代碼,函數名爲body->onbeforeunload =「return CloseOrNotClose(event);」mozilla的javascript格式
這適用於ie,但不適用於mozilla。
function CloseOrNotClose(event) {
var ie = document.all;
if (ie) {
if ((window.event.clientX < 0) || (window.event.clientY < 0)) {
return "Your Information related to this exam will be lost and you will have to reappear for it, \nDo you want to continue?";
}
}
else {
if ((event.clientX < 0) || (event.clientY < 0))
return "Your Information related to this exam will be lost and you will have to reappear for it, \nDo you want to continue?";
}
}
在所有其他的瀏覽器,'event'對象作爲參數傳遞給事件處理程序通過。 – 2011-03-30 10:58:25