My jQuery code (below) method gives following error:
TypeError: jQuery111007245809631238611_1456231588251 is not a function
$(function() {
// Ajax request sent.
var xhr = $.ajax({
url: 'http://gdata.youtube.com/feeds/api/videos/wbB3lVyUvAM?v=2&alt=jsonc',
data: {
format: 'json'
},
beforeSend: function() {
},
dataType: 'jsonp',
success: function(data) {
//console.log(data);
$('#info').html(data.error.message);
},
type: 'GET',
error: function() {
if (xhr.statusText == 'abort') {
$('#info').html('Aborted!');
return;
}
alert('error');
}
});
// Abort ajax request on click
$('#btn').on('click', function() {
xhr.abort();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<button id="btn">click to abort </button>
<div id="info"></div>
</body>
(also available at http://jsfiddle.net/e3ok3s6e/3/)
Is there any possible way to fix this error?