21310 Posts in 5739 Topics by 2604 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 805 Views |
-
outputting data as XML, and loading with jquery ajax

15 August 2011 at 9:44am
Hi all,
I've currently a whole load of data i'm outputting to a template, which constructs it in a XML format.
when the page is loaded, i'm to load the file I'm using
jQuery.ajax({
url: urlToLoad,
success: function(xml) { }
});However, I'm having a load of problems!
Firstly, in IE, I have to write $.ajax - and in firefox I have to put jQuery.ajax
of course, i need one line to do both!
2ndly, when file is loaded, I'm trying to load the data using:
jQuery(xml).find('marker').each(function(){
this works fine in firefox, but not IE
So, I either fix the above, or I'm just wondering if there is another, different way of using jquery to load data in...
Thanks all
-
Re: outputting data as XML, and loading with jquery ajax

15 August 2011 at 10:01am
Ok, I've crudely sovled the first bit adding
var myJQueryOb = $;
and then using
myJQueryOb.ajax({ });
and this works in IE and Firefox
I think the XML is to do with the fact i'm just using a SS template which looks like XML, but isn't an xml file:
http://stackoverflow.com/questions/562283/jquery-find-doesnt-return-data-in-ie-but-does-in-firefox-and-chrome -
Re: outputting data as XML, and loading with jquery ajax

15 August 2011 at 10:23am
You need to set the headers properly by putting the code below in the controller method that outputs the xml.
Check in firebug to make sure that the proper header is being set.$this->getResponse()->addHeader("Content-Type", "text/xml");
-
Re: outputting data as XML, and loading with jquery ajax

15 August 2011 at 11:02am
all works now...
even in ie6!
| 805 Views | ||
|
Page:
1
|
Go to Top |


