AngularJS ng在firefox上重复工作,但不在chrome和IE上重复工作?
我用$http.get加载了一些数据AngularJS ng在firefox上重复工作,但不在chrome和IE上重复工作?,angularjs,google-chrome,firefox,Angularjs,Google Chrome,Firefox,我用$http.get加载了一些数据 $http.get('toDOTasks.json') .success(function (response) { $scope.tasks = response; }); 那么我有: <div ng-repeat="task in tasks| filter:search | orderBy: orderType() | limitTo: show" class="row"> 它在f
$http.get('toDOTasks.json')
.success(function (response) {
$scope.tasks = response;
});
那么我有:
<div ng-repeat="task in tasks| filter:search | orderBy: orderType() | limitTo: show" class="row">
它在firefox中工作,但当我尝试chorome或IE时,它不工作,会有什么问题?您使用的是什么版本的angular。
在这种情况下,您可以使用1.2版进行尝试,因为if更兼容。请参阅angular docs您的控制台是否出现错误?是的,我得到:XMLHttpRequest无法加载file:///....JSON/toDoTasks.json. 跨源请求仅支持协议方案:http、数据、chrome、chrome扩展、https、chrome扩展资源。在ChromeI上,我使用1.4.6,但我尝试了1.2.29,它仍然是一样的,它只在Firefox上加载json,json在本地加载到项目中的同一目录中,这可能是问题吗?您是否从服务器访问它,如:localhost/index.html?或者只是使用file://?是的,这似乎是问题所在,我是从file://运行它的,我尝试使用localhost,它成功了,谢谢!你有没有找到一种方法在Chrome中解决这个问题?ng show命令的sum或count的angularjs或其他ng在Chrome中同时重复有没有任何限制?