JSON在浏览器中显示,但在移动应用程序中不显示

时间:2015-01-22 12:26:42

标签: android json angularjs cordova

您好我使用angularjs进行devloping应用程序和  这是我使用

的代码
<!DOCTYPE html>
<html class="no-js" lang="en" ng-app="myBusStopApp">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>My bus stop - Real time data</title> 
    <link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">   
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>   
    <script type="text/javascript">
    angular.module('myBusStopApp', [])
.controller('myBusStopCtrl', ['$scope', '$http', function ($scope, $http) {
   // $scope.realTimeData;
    var url ='http://eaglenew.comoj.com/JsonReturn.php';
 //   var url = "http://reis.trafikanten.no/reisrest/realtime/getrealtimedata/3010435" + "?callback=JSON_CALLBACK";
    $http.get(url)
        .success(function(data){
            $scope.realTimeData = data;
        //console.log(data+"ddddddddddddddd");      
        });
}]);</script>
</head>
<body style="margin-top:2%;font-size:14px;font-family:Open Sans; padding-left:2%;padding-right:2%;">
<div ng-controller="myBusStopCtrl">
    <center>
    <div class="table-responsive" style="max-width:800px;">
    <table class="table table-striped">
        <thead>
            <tr class="info">
            <th>Bus#</th>
            <th>Destination</th>
            <th>Wait time</th>          
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in realTimeData">
                <td>{{item.id}}</td>
                <td>{{item.email}}</td>
                <td>{{item | json }}</td>            
            </tr>
        </tbody>
    </table>
</div>
</center>
</div>
</body>
</html>

在此代码中,JSON数据显示在Web beowser中,但是当我尝试在手机中启动时,这不会显示任何数据

这是显示此 - >

{{item.id}} {{item.email}} {{item | json}}

在这种情况下

错误未在控制台中显示我该怎么办请帮助我......提前感谢

0 个答案:

没有答案