I’m using the modernish jquery 1.5 ajax request. To a page on the same domain.
I’m trying to improve upon behaviour in an intranet site using grease monkey and jquery.
var jqxhr = $.ajax("anotherpage-response.html")
.success(function(data) {alert("cmp"); console.log(data);})
.error(function() { alert("error"); })
.complete(function() { alert("complete"); });
Its currently being returned as a string. Any idea how I can get it returned as a dom like object which I can proccess using jquery selectors ???
I think im after something like fileType: html but it doesnt seem to be an option in the ajax request. Maybe I just need to read the api properly ???
Thanks
You should read up on jquery’s documentation on this subject: http://api.jquery.com/jQuery.ajax/
The thing you are looking for probably is the following: dataType.
I hope this helps