Bug Tracker

Opened 7 years ago

Closed 5 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:

Description

Hello,

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 5 years ago by addyosmani

  • Resolution set to worksforme
  • Status changed from new to closed

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.