谷歌地球插件自动刷新

时间:2012-05-04 07:30:11

标签: google-earth-plugin

有没有办法检测谷歌地球插件何时完成安装,以便我可以自动刷新页面?

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

1 个答案:

答案 0 :(得分: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?

相关问题