<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<ul>
<li ng-repeat="x in names">
{{ x.Name + ', ' + x.Country }}
</li>
</ul>
</div>
<script>
var app = angular.module('myApp', []);
alert(11);
app.controller('customersCtrl', function ($scope, $http) {
alert(22);
$http.get("http://xacjxl.applinzi.com/qingguo/Customers_JSON.php")//http://ctb.qingguo.com/sso/vcodelogin?phonenumber=13880305876&vcode=4023&orgid=1;;http://localhost:8888/qingguo/Customers_JSON.php
// $http.jsonp("http://localhost/sitesettings/getBadgeInfo.pt?jsonp=JSON_CALLBACK&siteid=137bd406")
.success(function (response) {
//var obj = JSON.parse(response.data);
//alert(obj);
$scope.names = response.records;
});
});
</script>
</body>
</html>
angular.js通过URL获取json并显示代码
最新推荐文章于 2021-06-24 13:56:32 发布