Bug Tracker

Opened 14 years ago

Closed 12 years ago

#4854 closed feature (worksforme)

Selector which select more than needed

Reported by: tam424 Owned by: john
Priority: minor Milestone: 1.3.2
Component: selector Version: 1.3.2
Keywords: find Cc:
Blocked by: Blocking:



There is a selector called "find". I'm using this selector with ajax and xml. The problem is only about the Firefox browser. I'm also checked it with Internet Explorer and Google Chrome. It is working fine.

The problem at Firefox is that the selector ignores my request to display only the infromation by the names and id I wrote. It displays the all information of the all tags. For example: xml file:

<body> <employee id="001" sex="M" age="19">Premshree Pillai</employee> <employee id="002" sex="M" age="24">Kumar Singh</employee> <employee id="003" sex="F" age="21">Suhasini Pandita</employee> </body>

I used: var info=$(_ResponoseXML_).find('body').find('#001').text(); alert(info); -> output should be: "Premshree Pillai", but the output at Firefox is: "Premshree Pillai Kumar Singh Suhasini Pandita"... and if there are more it displays the all values into the document.

I hope it will be useful for you.

Thank you, Tamir.

Change History (1)

comment:1 Changed 12 years ago by addyosmani

Resolution: worksforme
Status: newclosed

Your incorrect usage of jQuery in this case was retrieving you the entire set. If you instead do something like this Live Test Case (simplified, but works) you'll be able to just retrieve the single value you're after. This is not an issue with the jQuery core.

Note: See TracTickets for help on using tickets.