Accuweather花粉数Googleアプリを使用すると、IEでエラーが発生します。ここでIEでのJavascriptエラー(getElementsByTagName(...)。item(...) 'がnullまたはオブジェクトではありません)
は、直接スクリプトへのリンクです:ここでは
問題のサラウンドスクリプトです:
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で私は取得しています:
Webページエラーの詳細
ユーザーエージェント:Mozillaの/ 4.0(互換; MSIE 8.0; Windows NT 6.1;トライデント/ 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日8時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
このエラーの原因となっているものの任意のアイデア?
ありがとうございます。
コードの関連部分も追加してください。 –
スクリプトは私が投稿したトップリンクにあります(私はJSにちょっと新しくなっていますので、コードの "関連する"部分が本当に何であるかは分かりません)。 –
あなたを助けるためにリンクをたどる必要はありません(リンクが将来到達できない場合はどうなりますか?質問は無意味になります)。関連する部分は、エラーがスローされた行とその周囲のコードになります。このコード行は何でも依存します。 –