why does $.ajax(..) not work for me?
Posted
by dr jerry
on Stack Overflow
See other posts from Stack Overflow
or by dr jerry
Published on 2010-03-23T20:52:29Z
Indexed on
2010/03/23
20:53 UTC
Read the original article
Hit count: 245
jQuery
|jquery-ajax
I'm running jquery from a file. And I'm trying to load a svg file from my localhost to populate a svg canvas. However that does not work as expected. What I do from filesystem:
$.ajax({ url: url ,
timeout: 1000,
complete: function(xml) {
alert('complete');
},
success: function(xml, status, xreq) {
alert('success');
},
error: function() {
alert('error');
}
});
the url reads: http://localhost/image.svg, when I read this url directly from an addressbar from the browser, the pages remains white but the pagesource displays the source of image.svg.
Debugging the $.ajax code above, reveals that the success: method is hit, but xml response remains empty.
Any help is greatly appreciated.
regards,
jeroen.
© Stack Overflow or respective owner