我调用了一个 FlickrAPI,它返回xmlhttp.responseText
如下所示:
jsonFlickrApi({"photos":{"page":1, "pages":200, "perpage":100, "total":"19934",
"photo":[{"id":"7315581986", "owner":"62691288@N00", "secret":"504915125a",
"server":"7090", "farm":8, "title":"China, Tiananmen Square", "ispublic":1,
"isfriend":0, "isfamily":0}, {"id":"7308693706",
...
我尝试像这样解析它:
var jsonResponse = xmlhttp.responseText ;
jsonResponse = eval("("+jsonResponse + ")");
var output += jsonResponse.photos.photo[1].id ;
alert(output);
萤火虫告诉我:jsonFlickrApi is not defined
为什么我会收到此错误消息?
为什么我必须首先使用'eval'?