in a project, I tried to obtain the data of Douban API through jsonp, but found that the score changed from 7.1 to 6.
related codes
$(document).ready(function(){
if($("-sharpdouban_score").length > 0) {
var name = "";
$.ajax({
type: "get",
dataType: "jsonp",
jsonp:"callback",
timeout: 5000,
url: "http://api.douban.com/v2/movie/search?q="+ name +"&count=1",
error: function(){
alert("");
},
success:function(data){
if(data.subjects[0].rating.average!=0){
$("-sharpdouban_score").text(data.subjects[0].rating.average)
}
}
})
}
});
part of the data obtained by jsonp:
json