jQuery获取路径在某些特定情况下,您可能希望以独特的方式识别HTML元素-使用jQuery Selector或XPath -以便在另一个浏览器-不同的DOM - (例如:访问者鼠标和键盘实时监控)中选择它。用法$('body').bind('click.monitoring',function(e){ t//Get the element's jQuery selector t//It'll return something like this: #example-5>h4:eq(0) tvar sel = $.getPath(e.target); //is the same as $(e.target).getPath(); t t//Send to the server what element was clicked t//(and maybe