admin管理员组文章数量:1332980
I have onKeypress Event in Text Box This Works in FireFox, does not in IE
event is passed as undefined in IE
PriceInBox.onkeypress = function(event) { return moZoltarCurrent.evt_checkForInt(event); }
I have onKeypress Event in Text Box This Works in FireFox, does not in IE
event is passed as undefined in IE
PriceInBox.onkeypress = function(event) { return moZoltarCurrent.evt_checkForInt(event); }
Share
Improve this question
edited Sep 22, 2010 at 23:55
Marcel Korpel
21.8k6 gold badges62 silver badges80 bronze badges
asked Sep 22, 2010 at 23:50
PraveenPraveen
591 silver badge2 bronze badges
1 Answer
Reset to default 7You need to normalize the Event interface, as IE doesn't pass it along as a parameter, but uses a global variable:
PriceInBox.onkeypress = function(event) {
event = event || window.event;
return moZoltarCurrent.evt_checkForInt(event);
};
本文标签: javascriptEvent is Undefined in IE works in FirefoxStack Overflow
版权声明:本文标题:javascript - Event is Undefined in IE works in Firefox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742344844a2457317.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论