浏览器兼容性问题

来源:互联网 发布:西门子vb 编辑:程序博客网 时间:2024/05/17 08:54

判断浏览器是否是谷歌:

var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
   if(isChrome){
      if(windowFrame1.src==""&&MapAPI==null){
      windowFrame1.src="http://localhost:8080/x5/UI/gisTheme/map.html?random=" + Math.floor(Math.random()*100000);
      }
  }else{
     if(windowFrame1.location.href=="about:blank"&&MapAPI==null){
       windowFrame1.location.href = "http://localhost:8080/x5/UI/gisTheme/map.html?random=" + Math.floor(Math.random()*100000);
     }
  
  }

0 0