Bug Tracker

Opened 10 years ago

Closed 8 years ago

#4576 closed bug (invalid)

.find not performing properly on an XML document.

Reported by: Tegeril Owned by: Tegeril
Priority: minor Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: find, 1.3.2, getelementsbytagname Cc:
Blocked by: Blocking:

Description

If you use this ajax call:


var searchstring = "http://www.99restaurants.com/resources/proxy/KnowWhereProxy.php?state=CT";

$.ajax({

type: "GET", url: searchstring, dataType: "xml", success: function(obj){ onLoadState(obj);}, error:function(msg,x,y){ alert(msg);}

});


and then try to parse the resulting XML like this:


function onLoadState(data) {

var jLocations = $(data).find("Location"); jLocations.each(function(intLocationIndex) {

do something

});

}


jLocations has a length of 1. If you go var jLocations = data.getElementsByTagName("Location");, jLocations has a length of 16, returning all <Location> tags instead of just the first.

Change History (5)

comment:1 Changed 10 years ago by Tegeril

This implementation worked with JQuery 1.2.6.

comment:2 Changed 10 years ago by Tegeril

Rather, the .find implementation worked with 1.2.6, getElementsByTagName is the workaround for 1.3.2. Sorry for the lack of clarification.

comment:3 Changed 10 years ago by dmethvin

Component: unfilledselector
Owner: set to john

comment:4 Changed 9 years ago by dmethvin

Owner: changed from john to Tegeril
Status: newpending

Can you try with the most recent version?

comment:5 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.