天気予報読み込み。とりあえずメモです。

function LoadedData() {
tenkiChild = tenkiXML.firstChild.firstChild;
tenkiCnt = tenkiChild.childNodes;
i = 11;
tenkipath();
}
function tenkipath() {
clearInterval( tID );
_root.titles = tenkiCnt[i].firstChild;

//ループ処理です。ノードが無かったら元に戻る。
if (undefined == _root.titles){
LoadedData();
}else{
_root.titles = tenkiCnt[i].firstChild;
_root.link = tenkiCnt[i].firstChild.nextSibling.firstChild;
_root.description = tenkiCnt[i].firstChild.nextSibling.nextSibling.firstChild;
_root.pubDate = tenkiCnt[i].firstChild.nextSibling.nextSibling.nextSibling.firstChild;
i = 1+i;
tID = setInterval( tenkipath,1000 );
}
}

関連記事