I'm trying to read a remote file ; I'm using the example on the jquery.get() documentation page :
var jqxhr = $.get( 'http://stackoverflow.com/feeds/question/10943544', function() {
alert( 'success' );
})
.done(function() {
alert( 'second success' );
})
.fail(function(jqXHR, textStatus, errorThrown) {
// alert( 'error' );
console.log('Error: (' + errorThrown + ')');
})
.always(function() {
alert( 'finished' );
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
But it only triggers "fail" and "always" and I'd like to understand why ; My question is : How can I obtain a readable error? Currently, the console.log("Error: (" + errorThrown + ')');
only yields Error: ()
.
Bonus question: Why does it fail? How can I read a remote (RSS) file using JS/JQuery?