TypeError:jQuery.browser未定义 [英] TypeError: jQuery.browser is undefined
本文介绍了TypeError:jQuery.browser未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用jquery mobile 1.4.2和脚本1.11.0
I am using jquery mobile 1.4.2 and script 1.11.0
我已经阅读过有关此问题的问题,但是我没有在代码中使用它.
I have read previously asked questions about this but i didn't get how to use in my code.
这是我的代码
jQuery("input[name^='cat']").bind(jQuery.browser.msie ? 'click' : 'change', function(event) {
var id = jQuery(this).attr('id');
mantener_seleccion(id);//its a function name
});
如果我运行此显示错误,例如"TypeError:jQuery.browser is undefined" 请任何人帮助我.
if i run this its showing error like this "TypeError: jQuery.browser is undefined" Please any one help me in this.
推荐答案
不推荐使用jQuery.browser. 此属性已在jQuery 1.9中删除
Demo
if(navigator.userAgent.toUpperCase().indexOf('MSIE') >= 0){
alert("IE")
}
使用以下代码段:
var isIE = navigator.userAgent.toUpperCase().indexOf('MSIE') >=0 ? 'click' : 'change' ;
jQuery("input[name^='cat']").bind(isIE , function(event) {
var id = jQuery(this).attr('id');
mantener_seleccion(id);//its a function name
});
这篇关于TypeError:jQuery.browser未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文