if(/msie/.test(navigator.userAgent.toLowerCase())){
if(window.navigator.userAgent.indexOf("MSIE 9")!==-1){
$(this).find('input')[0].attachEvent("onkeyup",function(e){
textChangeIE9(e);
})
}else{
$(this).find('input')[0].attachEvent('onpropertychange',txtChange);
}
if(window.navigator.userAgent.indexOf("MSIE 9")!==-1){
$(this).find('input')[0].attachEvent("onkeyup",function(e){
textChangeIE9(e);
})
}else{
$(this).find('input')[0].attachEvent('onpropertychange',txtChange);
}
本文介绍了一段优化IE9输入框键盘事件处理的JavaScript代码,通过判断浏览器版本,采用不同的事件监听方式来提升用户体验。
1233

被折叠的 条评论
为什么被折叠?



