Monday, March 30, 2009

[jQuery] AJAX - ignore mime type

Hi,

My ajax requests return xml, with the corresponding mime type.

I'm using $.get, as so:

$.get(
$(this).attr('href'),
function(data, textStatus)
{
$('#requestArea').val(data);
},
'html' //type, correct?
);

$('#requestArea').val(data) sets a text area to say [object
XMLDocument]

So it seems my setting the type to html does nothing!

I've played around with this a bit, including using other ajax methods
apart from .get(), with the same results.

Am I missing something here?

Thanks in advance!

No comments: