首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >google earth插件自动刷新

google earth插件自动刷新
EN

Stack Overflow用户
提问于 2012-05-04 15:30:11
回答 1查看 350关注 0票数 1

有没有办法检测谷歌地球插件何时安装完毕,这样我才能自动刷新页面?

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-05-05 04:52:53

您可以使用此函数每秒检查一次是否支持插件以及是否已安装。

代码语言:javascript
复制
  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?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10444577

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档