简体   繁体   English

在IE11中未定义Xpathresult

[英]Xpathresult is undefined in IE11

I am using some javascripts. 我正在使用一些javascripts。 I used 我用了

var xpathResults = document.evaluate(xpath, domContext, null, XPathResult.ANY_TYPE, null);

it is working fine in all the browser except IE11. 它在除IE11之外的所有浏览器中都能正常工作。 It is showing error: ' XPathResult is undefined '. 它显示错误:' XPathResult is undefined '。 And yes I used wgxpath.install.js script before that. 是的,我之前使用过wgxpath.install.js脚本。

Thanks in advance 提前致谢

Internet Explorer does not support XPATH. Internet Explorer不支持XPATH。

I'd suggest using CSS selectors instead of XPath if you want it to work with IE11. 如果你想让它与IE11一起使用,我建议使用CSS选择器而不是XPath。

If you are dead-set on using XPath, I'd suggest using an XPath javascript library (like http://code.google.com/p/wicked-good-xpath/ ) 如果您对使用XPath感到不满,我建议您使用XPath javascript库(例如http://code.google.com/p/wicked-good-xpath/

Sorry for the trouble. 抱歉,添麻烦了。 Support for XPath in IE is currently in development. IE中对XPath的支持目前正在开发中。

If you are curious what we have planned for IE-Next, visit http://status.modern.ie/ 如果您对我们为IE-Next计划的内容感到好奇,请访问http://status.modern.ie/

I am also facing same issue. 我也面临同样的问题。 Put following code in your HTML head section and try it. 将以下代码放在HTML头部分中并尝试使用它。

<meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1" />

I faced same problem.Add following code will be useful. 我遇到了同样的问题。添加以下代码将非常有用。

<meta http-equiv="X-UA-Compatible" content="IE=5">

Note: IE=5 ,NOT OTHERS. 注意: IE=5 ,不是其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM