Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

outputting data as XML, and loading with jquery ajax

Go to End

4 Posts   1561 Views


Community Member, 244 Posts

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

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:


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


Community Member, 244 Posts

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:


Community Member, 288 Posts

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");


Community Member, 244 Posts

15 August 2011 at 11:02am

all works now...
even in ie6!