UPDATE 1:
I've just upgraded from jquery 1.4.4 to 1.6.1. How does that effect the script in the original question?
ORIGINAL QUESTION:
Just as I test, I did:
$(document).ready(function() {
get_jsonp_feed();
function get_jsonp_feed() {
$.ajax({
url: 'http://www.remote_host.co.uk/feed.php',
type: 'GET',
dataType: 'jsonp',
jsonp: 'callback',
jsonpCallback: 'jsonpCallback',
error: function(xhr, status, error) {
alert("error");
},
success: function(jsonp) {
alert("success");
}
});
}
function jsonpCallback(data){
alert("jsonpCallback");
}
});
I was expecting to get 2 alerts, the first showing success
and the second showing jsonpCallback
. But I am only getting the first alert success
. Why is the second alert not showing up?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…