3

私のクライアントには、IE10 でエラーをスローし始めた Web アプリがあります。エラーの原因を突き止めたところ、IE 10 では selectSingleNode がサポートされなくなったようです。これが使用される関数は次のとおりです。



    ScormApi.prototype.setTom = function( tom ) {
         this.tom = CreateXmlDocument();
         var rootelem = importAllNode( this.tom, this.tomTemplate.documentElement, true );
         this.tom.appendChild( rootelem );
         // Transforms the tracing of the user in tracking template
         // Perform the navigation on all nodes of tom and for each value found
         // Sets it to this.tom
         rootelem = tom.selectSingleNode('//cmi');
         this.parseXML( rootelem, '/' , this, this.setTomParam );
    }

次のコードで呼び出されます。



    var ajxreq = new Ajax.Request(
    this.baseurl+'?op=Initialize',
    {   method: 'post',
         asynchronous:false,
         postBody: strSoap,
         requestHeaders: {
             'Man':"POST " + this.baseurl + " HTTP/1.1",
             'Host':this.host,
             "Content-type":"text/xml; charset=utf-8",
             "SOAPAction":this.serviceid + "Initialize",
             "X-Signature":playerConfig.auth_request
         }
    });

    if( ajxreq.transport.status == 200 ) {
         try {
             this.setTom( ajxreq.transport.responseXML );
         }
    }

応答タイプを msxml-document に変更する、querySelector を使用する、または jQuery の find 関数を使用するという提案を見つけましたが、このプロトタイプ フレームワークで実際に実装する方法をまとめることができません。どんな援助でも大歓迎です。

4

2 に答える 2

2

http://doogalbellend.blogspot.fr/2012/04/cross-browser-selectsinglenode-for-xml.htmlについては

更新 – AJAX 呼び出しから返される XML ドキュメントから selectSingleNode が削除されたため、これは IE10 では機能しなくなりました。これは、次のように XmlHttpRequest の応答タイプを設定することで回避できます。

xhr.responseType = 'msxml-ドキュメント';

responseType: 'msxml-document'オプションを追加してリクエストを変更すると、うまくいくはずです。

于 2013-07-19T10:26:01.890 に答える