希望使用 Accuweather 花粉计数谷歌应用程序,但它在 IE 中引发错误。
这是直接脚本的链接:
这是有问题的环绕脚本:
function setContent(url) {
_IG_FetchXmlContent(url, function (response) {
if (!response) {
msg.createDismissibleMessage("Error loading location data. Please try again later.");
echoDefault();
} else if (response.firstChild.nodeName != 'error' &&
parseInt(response.getElementsByTagName('citylist').item(0).getAttribute('us'))
+ parseInt(response.getElementsByTagName('citylist').item(0).getAttribute('intl'))
+ parseInt(response.getElementsByTagName('citylist').item(0).getAttribute('extra_cities'))) {
mylocation = response.getElementsByTagName('location').item(0).getAttribute('location');
url = 'http://whapw.accu-weather.com/widget/whapw/weather-data.asp?location=' + mylocation;
_IG_FetchXmlContent(url, function (response) {
if (!response) {
msg.createDismissibleMessage("Error loading pollen data. Please try again later.");
echoDefault();
} else {
var tree = response.getElementsByTagName('tree').item(0).firstChild.nodeValue;
var weed = response.getElementsByTagName('weed').item(0).firstChild.nodeValue;
var grass = response.getElementsByTagName('grass').item(0).firstChild.nodeValue;
var mold = response.getElementsByTagName('mold').item(0).firstChild.nodeValue;
var airquality = response.getElementsByTagName('airquality').item(0).firstChild.nodeValue;
var airqualitytype = response.getElementsByTagName('airqualitytype').item(0).firstChild.nodeValue;
var airqualitystyle = '';
从这一行报告错误:
} else if (response.firstChild.nodeName != 'error' &&
在 FF/Chrome 中运行良好,但在 IE 中我得到:
网页错误详情
用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 6.1;Trident/4.0;SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729;Media Center PC 6.0;InfoPath。 2;3M/MSIE 8.0) 时间戳:2011 年 8 月 5 日星期五 08:01:57 UTC
Message: 'getElementsByTagName(...).item(...)' is null or not an object
Line: 986
Char: 12
Code: 0
URI: http://www-igprev-opensocial.googleusercontent.com/gadgets/ifr?exp_rpc_js=1&exp_track_js=1&url=http%3A%2F%2Fwhapowllc.googlepages.com%2Fpollen.xml&container=igprev&view=default&lang=en&country=US&sanitize=0&v=45408d622dfd6df4&parent=http://www.google.com&libs=core:core.io:core.iglegacy:auth-refresh&is_signedin=1&synd=igprev&view=default
任何想法是什么导致了这个错误?
提前致谢。