2012-05-04 53 views
1

有什么方法可以检测谷歌地球插件完成安装,所以我可以自动刷新页面?谷歌地球插件自动刷新

即使安装时没有事件触发,也许我可以定期检查一次javascript间隔是否已安装?

回答

1

您可以使用此功能每秒检查一次插件支持,以及是否安装。

function googleEarthErrors() { 
     if (google.earth.isSupported()) { 
      alert('Google Earth Plugin is supported for this browser'); 
     } else { 
      alert('Google Earth Plugin is NOT supported for this browser'); 
      return false; 
     } 
     if (google.earth.isInstalled()) { 
      alert('Google Earth Plugin is installed'); 
     } else { 
      alert('Google Earth Plugin is NOT installed'); 
      setTimeout('googleEarthErrors()', 1000); 
    } 

显然,你需要的东西更有用,少恼人的:)

而且更换提醒,你应该看看这个答案 - How to check for presence of the google earth plugin using JavaScript?