Opened 14 years ago
Closed 12 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 14 years ago by
comment:2 Changed 14 years ago by
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 13 years ago by
Component: | unfilled → selector |
---|---|
Owner: | set to john |
comment:4 Changed 12 years ago by
Owner: | changed from john to Tegeril |
---|---|
Status: | new → pending |
Can you try with the most recent version?
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Automatically closed due to 14 days of inactivity.
This implementation worked with JQuery 1.2.6.