angularjs$http-为什么不获取json?
我使用的是ionic框架,为什么不获取jsonangularjs$http-为什么不获取json?,angularjs,ionic-framework,Angularjs,Ionic Framework,我使用的是ionic框架,为什么不获取json .controller('SearchCtrl', function($scope,$http) { $http({method: 'GET', url: 'dwz.cn/create.php?url=www.qq.com'}).success(function(data) { $scope.= myUrl; // response data }); }) 视图: <ion-view title="
.controller('SearchCtrl', function($scope,$http) {
$http({method: 'GET', url: 'dwz.cn/create.php?url=www.qq.com'}).success(function(data)
{
$scope.= myUrl; // response data
});
})
视图:
<ion-view title="url">
<ion-content class="has-header padding">
{{myurl}}
</ion-content>
</ion-view>
$scope.=myUrl
你的url
:`behttp://dwz.cn/create.php
?如果没有http协议位,您将在自己的服务器上查找dwn.cz
子目录。您将在自己的服务器上查找dwn.cz子目录。但我用的是API@user3652260:你的浏览器不知道你在做什么。它会将其视为一条路径。返回json,但无法访问
.controller('SearchCtrl', function($scope,$http) {
$http({method: 'GET', url: 'new.json'}).success(function(data)
{
$scope.= myUrl; // response data
});
})