2010-09-22 57 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

相关问题