$.post('service.php?getPhotos', function(data){
var photoIds = [];
$.each(data, function(){
photoIds.push(this.id);
});
console.log(_photoId); //7962669392
console.log(photoIds); //["7980686507", "7962669392", "7962163506"]
console.log($.inArray(_photoId, photoIds)); //-1
});
为什么不console.log($.inArray(_photoId, photoIds));
回来1
?