2010-09-22 32 views
6

工作我有onkeypress事件事件在文本框這在Firefox,不能在IE事件在IE未定義在Firefox

事件爲未定義在IE

PriceInBox.onkeypress = function(event) { return moZoltarCurrent.evt_checkForInt(event); } 

回答

7

傳遞你需要標準化事件界面,IE doesn't pass it along作爲參數,而是使用了一個全局變量:

PriceInBox.onkeypress = function(event) { 
    event = event || window.event; 
    return moZoltarCurrent.evt_checkForInt(event); 
}; 
+0

真棒它工作的感謝.... – Praveen 2010-09-23 00:02:30

+0

這一長期刺激性* *最終固定與事件IE9標準模式中的模型更改。 – bobince 2010-09-23 00:16:22

+1

IE9確實看起來正在制定大量的地面標準。 – 2010-09-23 00:25:46

相關問題