我的客户有一个 Web 应用程序开始在 IE10 中引发错误。我追踪了错误的来源,似乎 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 函数的建议,但我无法拼凑出如何在这个原型框架中实际实现它。任何帮助将不胜感激。