angular.module('myApp',[]).controller('test11',
function test11($scope,$http)
{
$http.jsonp("https://api.github.com/repos/cs1707/blog/posts?callback=JSON_CALLBACK")
.success(
function(data)
{
console.log(JSON.stringify(data));
});
}
function test11($scope,$http)
{
$http.jsonp("https://api.github.com/repos/cs1707/blog/posts?callback=JSON_CALLBACK")
.success(
function(data)
{
console.log(JSON.stringify(data));
});
}
);
为什么下列json是ok.
{"meta":{"X-RateLimit-Limit":"60","X-RateLimit-Remaining":"46","X-RateLimit-Reset":"1437389126","X-GitHub-Media-Type":"github.v3","status":404},"data":{"message":"Not Found","documentation_url":"https://developer.github.com/v3"}} 。但是返回
{"result":true,"message":[{"task_id":1,"task_name":"nameq","task_description":"sjdfhd","operatename":"x-man","create_time":1433217515000,"update_time":1433670943000,"is_delete":1,"ETL_email":"ETL@vipshop.com"}]} 就报错 Uncaught SyntaxError: Unexpected token :
需要进一步探究