Chinaunix首页 | 论坛 | 博客
  • 博客访问: 328334
  • 博文数量: 47
  • 博客积分: 2667
  • 博客等级: 少校
  • 技术积分: 480
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-10 11:25
文章分类

全部博文(47)

文章存档

2015年(2)

2012年(4)

2011年(4)

2010年(37)

我的朋友

分类: 系统运维

2010-04-10 13:44:10

 
if(document.all){ //ie
     window.attachEvent('onload',addCountry);
}else{ //ff
     //自动加载函数
     window.addEventListener('load',addCountry,false);  
}
  
  
 
function getBrowserType(){
     if(navigator.userAgent.indexOf("MSIE")>0) {
          return 1;
     }
     if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
          return 2;
     }
     if(isSafari=navigator.userAgent.indexOf("Safari")>0) {
          return 2;
     }
     if(isCamino=navigator.userAgent.indexOf("Camino")>0){
          return 2;
     }
     if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){
          return 2;
     }
     return 1;
}
阅读(646) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-07-12 17:37:49

hoho 不错不错 收藏该function先,以备不时之需 硬盘数据恢复 http://www.raidcn.org