Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpath locus search not working in IE #228

Open
lmvco opened this issue Oct 22, 2013 · 4 comments
Open

Xpath locus search not working in IE #228

lmvco opened this issue Oct 22, 2013 · 4 comments

Comments

@lmvco
Copy link
Contributor

lmvco commented Oct 22, 2013

Hi,

The locus search tests available in Monocle - http://test.monoclejs.com/test/locus-search/index.html - that use xpath does not work in IE10.

It throws the error below:
"SCRIPT438: Object doesn't support property or method 'evaluate' "

It seems to be caused by lack of xpath support in IE.

My suggestion is to use a library that implement xpath quering like xpathjs - https://github.com/andrejpavlovic/xpathjs

Is it possible?

@joseph
Copy link
Owner

joseph commented Oct 25, 2013

Sounds like a good idea, but you can do this in your application, right? I'd rather not introduce a dependency in Monocle...

@aronwoost
Copy link

Just want to add that xpathjs is awesome. Have worked with it on earlier Androids. Just make sure you check this issue when working with xhtml content.

@lmvco
Copy link
Contributor Author

lmvco commented Oct 28, 2013

Hi Joseph,

I cannot do it on my application because I am using Monocle moveTo function passing a Xpath as argumentm (error throw in inside monocore.js) - pageForXPath function.

I understand your concerns regarding externals library dependencies. However, since Internet Explorer is increasing popularity - with Surface and other Windows 8 tablets - I suggest to create this dependency until Microsoft add a full support to xpath in Internet Explorer.

Anyway, I found another xpath library from Google that is very interesting also:

Wicked Good XPath is a Google-authored pure JavaScript implementation of the DOM Level 3 XPath specification. It enables XPath evaluation for HTML documents in every browser. We believe it to be the fastest XPath implementation available in JavaScript.

https://code.google.com/p/wicked-good-xpath/

@joseph
Copy link
Owner

joseph commented Oct 30, 2013

Hm, I'm confused — according to the XPathJS doc, XPathJS.bindDomLevel3XPath(); will shim in document.evaluate. So it should be transparent?

To be honest, given the state of XPath support in various browsers (including the zombie Androids), I've been thinking of ditching it from the locus object altogether — CSS selectors are arguably easier and certainly better supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants