7
JavaScript/Ajaxを使用していますか?XML名前空間の解析?
私はから値を抽出しようとしている:のようなものを探してい
<yweather:astronomy sunrise="6:34 am" sunset="8:38 pm"/>
:
var response = transport.responseXML.getElementsByTagName("channel");
sunrise = response[0].getElementsByTagName("yweather:astronomy").item(0).Attributes["sunrise"].Value;
しかし、何がこれまで機能しません。 : '( おかげ
IEではサポートされていませんが、それ以外は正しく – annakata
@annakata:興味がありません。あなたはIEでどうやってそれをすることができますか? –
IEでgetElementsByTagName( "yweather:astronomy")を使うだけでいいと思います。また、GoogleフィードAPIにはクロスブラウザ実装があります。おそらく、それを使用することができます:http://code.google.com/apis/ajaxfeeds/documentation/reference.html#getElementsByTagNameNS – dylanfm