Bug Tracker

Modify

Ticket #4854 (closed feature: worksforme)

Opened 5 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by addyosmani

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

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.