StupidBeauty
Read times:761Posted at:Fri Sep 27 01:21:49 2013
- no title specified

转载:jQuery 1.9 移除了 $.browser 的替代方法

javascript中可使用 $. browser . mozilla = /firefox/ . test ( navigator. userAgent . toLowerCase ()) ; 这样一句代码来判断当前浏览器是不是火狐。

http://www.fwolf.com/blog/post/35

亮点:

判断浏览器类型:

$.browser.mozilla = /firefox/.test (navigator.userAgent.toLowerCase ()) ;

$.browser.webkit = /webkit/.test (navigator.userAgent.toLowerCase ()) ;

$.browser.opera = /opera/.test (navigator.userAgent.toLowerCase ()) ;

$.browser.msie = /msie/.test (navigator.userAgent.toLowerCase ()) ;

等号后面的表达式返回的就是 true/false, 可以直接用来替换原来的 $.browser.msie 等。

办公室女郎

办公室女郎

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands