Reputation: 37
var jqxhr = $.get('/download.svg', function () {
})
.done(function (data) {
alert("done");
})
I have a svg file saved in my local system and i got this file through jquery get which is working fine and returning a data document. I need to get xml string of that svg file. How can i get that ?
Upvotes: 0
Views: 806
Reputation: 6059
Set the dataType
argument to xml
when calling get()
:
$.get('/download.svg', function(svg) {
console.log( svg );
}, 'xml');
With older jQuery versions, you might need to use text
as data type:
$.get('/download.svg', function(svg) {
console.log( svg );
}, 'text');
Upvotes: 1