ilinsky / jquery-xpath

jQuery XPath plugin (with full XPath 2.0 language support)
180 stars 64 forks source link

frame and iframe not supporting #3

Closed akshaya14 closed 11 years ago

akshaya14 commented 11 years ago

when given a frame or iframe in the jQuery part and then giving xpath of the element in .xpath is not working.

have tryed giving iframe,frame inside the xpath expression only as well. it did't work.

for frame page u have cnn or any news web sit... ex: $("[name='Frame1']").contents().find("").xpath("//input[@id='Chk2']").attr("checked",true); $(window.top.frames[name='Frame0'].frames[name="Frame1"].document).contents().xpath("//input[@id='Chk2']").attr("checked",true);

Thanks in advance

akshaya14 commented 11 years ago

if any work around or if i am wrong please correct me....:)

ilinsky commented 11 years ago

Code that causes this behavior is https://github.com/ilinsky/jquery-xpath/blob/master/src/jquery-xpath.js#L40 Here, the type of node is determined - HTML or XML (which is needed in order to properly choose evaluation context and default namespace). I'll try to find a way how to rewrite this code in order for it to work with frames.

ilinsky commented 11 years ago

Fixed in rev 9036e113a07cabff008e154b8c7f670ab99e1837 New build to follow shortly

ilinsky commented 11 years ago

Reopening as the fix provided does not work in FF

ilinsky commented 11 years ago

Hacked per rev c6509e1512263548f75dc9c28837367a5e04b0e5