在Angularjs中我们可以使用$ http服务使用方法“JSONP”
发送数据 $http({
method: 'JSONP',
url: 'http://plv.localhost/register?callback=JSON_CALLBACK',
data : { name : 'some name' }
}).success(function(data, status , header, config){
console.log('success');
}).error(function(data, status , header, config){
console.log('error');
});
答案 0 :(得分:1)
是的,你可以!见ng.$http
。您的url
缺少callback
参数:
$http({
method: 'jsonp',
url: 'http://plv.localhost/register?callback=JSON_CALLBACK',
params: { name: 'some name' }
}).success(function(data, status , header, config) {
console.log('success');
}).error(function(data, status , header, config) {
console.log('error');
});