“google is undefined” [英] "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屋!