“google is undefined” [英] "google is undefined"

查看:282
本文介绍了“google is undefined”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用适用于FF3和Safari的Gears; IE6 / 7报告页面加载时出现google is undefined错误,出现在gears_init.js中。
快速网络搜索显示Google的Javascripts实际上在IE7中造成了问题。有没有人有解决方法的想法?

I'm using Gears which works well in FF3 and Safari; IE6/7 both report a "google is undefined" error on page load, appearing in gears_init.js. A quick web search showed that Javascripts by Google are actually causing problems in IE7. Does anybody have an idea for a workaround?

推荐答案

这可能是因为IE6 / 7没有安装齿轮。这意味着谷歌相关代码将无法使用。

This is probably because IE6/7 don't have gears installed. That means the google related code won't be available.

您可能只想做类似的事情:

You probably just want to do something like:


if ( !window.google ) {
    alert("please install google gears");
}
else {
    // gears is available
}

虽然实际上你想要做一些比告诉用户下载齿轮的警报更好的东西。

Though in reality you'd want to do something a bit nicer than showing an alert to tell the user to download gears.

这篇关于“google is undefined”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆