Because the query using the to selector path to resolve the element may be a made at a much later time, in a different session, on a different machine etc. I simply need to build an efficient path to an element to be able to retrieve the element at anytime in the future (assuming that the dom structure hasn;t changed).
2009/3/1 jQuery <jquery-dev@googlegroups.com> > #4231: Add new "path" method which returns selector path to jQuery object > > -----------------------+---------------------------------------------------- > Reporter: strykker | Owner: john > Type: feature | Status: new > Priority: minor | Milestone: 1.3.3 > Component: selector | Version: 1.3.2 > Resolution: | Keywords: > Need: Review | > > -----------------------+---------------------------------------------------- > > Comment(by bentruyman): > > Why can't you just store the element you want to refer back to later in a > variable? This is something I do quite often, that is, store pointers to > DOM elements for later use. > > {{{ > var menu = {}; > menu.container = $('#myMenu').get(0); > menu.buttons = $('a', menu.container).get(); > }}} > > This way you have direct pointers to the elements, and if their placement > changes over time, these pointers still work -- whereas if you had a > '''path''' method that generated a path for you, it would break if the > elements moved. > > -- > Ticket URL: <http://dev.jquery.com/ticket/4231#comment:3> > jQuery <http://dev.jquery.com> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---