我在我的网站上运行此代码以获取一组照片,但我总是会出错。控制台日志显示“parsererror”。我究竟做错了什么?
中间.php
<?php die(file_get_contents($_REQUEST['url'])); ?>
脚本.js
//Flickr
var url = encodeURIComponent('http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=1408bff5f72a4b84b924d13e8562b6a2&photoset_id=77649470@N03&photoset_id=72157629903184261&format=json');
$.ajax({
url: "middle.php?url="+url,
dataType: "json",
success: function(){
console.log("yes");
},
error: function(jqXHR, textstatus, errorThrown){
console.log("nooo");
console.log( textstatus );
}
});