- function userBrowser(){
- var browserName=navigator.userAgent.toLowerCase();
- if(/msie/i.test(browserName) && !/opera/.test(browserName)){
- alert("IE");
- return ;
- }else if(/firefox/i.test(browserName)){
- alert("Firefox");
- return ;
- }else if(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)){
- alert("Chrome");
- return ;
- }else if(/opera/i.test(browserName)){
- alert("Opera");
- return ;
- }else if(/webkit/i.test(browserName) &&!(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName))){
- alert("Safari");
- return ;
- }else{
- alert("unKnow");
- }
- }
posted @
2014-08-20 15:35
狩猎者一号
阅读(
107)
评论()
编辑
收藏
举报