我在js文件中使用“XPathEvaluator”内置函数,但它会抛出错误,如
"'XPathEvaluator' is undefined".
我添加了代码 - >
var Evalt = new XPathEvaluator();
var luate = Evalt.evaluate(path,ss,sd,null);
这里有什么问题?我错过了任何名称空间/库吗? 我正在使用IE 8。 请提出一些答案。
答案 0 :(得分:0)
此实际错误是...
ReferenceError: 'XPathEvaluator' is undefined
根据文章,Resolving the Error "XPathEvaluator’ is undefined"此 XPathEvaluator未定义脚本错误通常是在升级到internet-explorer-11后在 Microsoft Dynamics CRM 2011 中观察到的。进一步的调查显示,任何包含ClientGlobalContext.js
(用于获取父表单的上下文)的HTML资源都将引发错误SCRIPT5009: ‘XPathEvaluator’ is undefined
。
解决方案是将以下行添加到引用该特定 JS 文件的自定义HTML文档的<head>
中:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
脚本的这一行用于强制浏览器以internet-explorer-10模式运行Web资源。
警告:缺点是此功能将在microsoft-edge(已被Microsoft新发布的 Internet Explorer 替代产品)中折旧。