var vTableExp = "//a[contains(@href,开发者_如何学编程'newdid')]/ancestor::td/ancestor::tr/ancestor::tbody";
var vTable = dom.find(vTableExp, XPFirst);
thanks
It is an XPATH searching against the DOM, looking for wrapping <TBODY>
elements which have a descendant <a>
whose href
contains "newdid".
It finds the first tbody
which is an ancestor of a a tr
element which is an ancestor of a td
element which is an ancestor of an a
element whose href
contains the string newdid
. (IOW, assuming that the parsed document is (X)HTML, select the body of the first table that has a cell containing a link whose address contains the string newdid
.)
vTableExp
is probably a regexp pattern and then it's being searched for.
精彩评论