JQuery .get xml crossdomain call inconsistencies

souldwar

New Member
I have been reading around this subject all morning, but I am still confused by the results.From what I understand JQuery .ajax .get should not work cross browser using datatype="xml", however the following rs feed does work\[code\]var rssurl = 'http://gdata.youtube.com/feeds/base/videos/-/trees?orderby=published&alt=rss';\[/code\]Yet when I try and call another feed it doesn't work. It gives a parseerror.\[code\]var rssurl = 'http://api.flickr.com/services/feeds/photos_public.gne?tags=trees&format=rss2'\[/code\]Now this feed that doesn't work, does work, when I copy it locally and call it. Which is why I think it is a crossdomain issue.Also, when viewing in Fiddler, I can see the feed is actualy downloaded. Which I find strange as why would this hapen if it is a crossdomain call, surely it would stop before the feed is pulled?Below the code to pull the feed.\[code\]$.ajax({ type: "GET", url: rssurl, dataType: "xml", success: function(data, textStatus, jqXHR) { document.write("got the feed: "+ textStatus+"
"); var $xml = $(data); $xml.find("item").each(function() { var $this = $(this), document.write( $this.find("title").text() ); }); }, error: function(jqXHR, textStatus, errorThrown){ alert('failure'); console.log('status: ' + textStatus); if (textStatus == 'error') console.log(errorThrown); } );\[/code\]So onto my questions:[*]Why would I be able to make a cross-domain call to one feed and not another; shouldn't both be banned?[*]If the 2nd feed did contain erros, why would it work locally?[*]arghhhhhhhhhhhhhhhcheers
 
Back
Top