javascript - How to write cross browser XPath queries using wicked good xpath library? -


i known 1 of stackoverflows reply if want write cross browser xpath queries there library exist called wicked xpath query google. here link wicked xpath

does has implemented such? if yes please directs me on regarding how write xpath query cross browser base. targeted browsers ie (7,8,9,10) , google chrome. working example can check in both ies , google chrome appreciated.

i expecting solution should working in ie 10 too. reason behind writing cross browser xpath don't have worry minor changes in executing xpath queries in different browsers.

appreciating further assistance.

edit:

bit more explanation solution sergey ilinsky's answer accepted:

here writing 1 example working purely in xml data can idea.

let if have xml structure below one

<elementnode id="13" std="1">     .... </elementnode> 

then can write xpath query below

<script type="text/javascript">     (function() {         res = $.xpath($("#selectorid"),"//elementnode[@id='10']");         console.log(res[0].getattribute("id")); //will print 10 in console         console.log(res[0].getattribute("std")); //will print 1 in console     })(); </script> 

you may want try jquery xpath plugin support xpath 2.0 syntax cross-browser.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -