【发布时间】:2015-05-19 23:31:57
【问题描述】:
在我看来,我正在通过 AngularJS 服务加载一些数据。这适用于现代浏览器,但在 Internet Explorer 9 及更低版本中非常失败。当我调用返回(通常)JSON 之类的控制器时
[{"id":2,"title":"Product","slug":"product","short_description"...}]
正在 IE9 中打开“保存”对话框。因此,服务中的调用返回当前 HTML 站点的标记。看起来像这样:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
...
控制器中的方法调用如下所示:
Product.get()
.success(function(data) {
$scope.products = data;
$scope.loading = false;
})
.error(function(msg) {
$log.error(msg);
});
Product.get()-Service 基本上就是$http.get('http://localhost:8000/api/products')
更新:this.JSON 返回 false...您能建议一个解决方法吗?
提前致谢!
【问题讨论】:
标签: json angularjs internet-explorer-9