1
我是新来AngularJS,我正在写经$ HTTP JSONP方法收到
有回调JSON数据的应用程序。缓存参数未设置,但浏览器缓存数据。我该如何解决这个问题?AngularJS是缓存JSONP默认
$scope.fetch=function() {
$http({method: 'JSONP', url: 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero'})
.success(function(data) {
$scope.current = data.salutation.toLowerCase();
console.log($scope.current);
$scope.dim=$scope.current; doIt();}).error(function(data) {
$scope.current = data.salutation.toLowerCase() || "Request failed"; $scope.dim=$scope.current;});
};
,这是我写的代码.. $ scope.fetch =函数(){$ HTTP({方法: 'JSONP' ,网址:“http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero'}).success(function(data){$ scope.current = data.salutation.toLowerCase();的console.log ($ scope.current); $ scope.dim = $ scope.current; doIt();})。error(function(data){$ scope.current = data.salutation.toLowerCase()||“Request failed”; $ scope.dim = $ scope.current;}); }; – davitp 2013-04-11 19:08:01
小心把它放在你的问题,所以它可以正确格式化? – Travis 2013-04-11 19:09:39
我改变了问题......仍然不明白为什么有一个缓存启用? – davitp 2013-04-11 19:16:30