提问人:Ayesha 提问时间:12/16/2015 最后编辑:PiotrWolkowskiAyesha 更新时间:12/16/2015 访问量:217
将服务器端文件传递给 angular 的 $http.get 函数
Pass server side file to angular's $http.get function
问:
我想获取一个服务器端JSON文件,并在AJAX get方法中使用它。一旦我们有了文件,我就可以在网格中显示。这是它的函数。
在我给出 2 个和 4 个反斜杠之前,它不会识别位置,如下所示
$http({
method:'GET',
url: '\\\\sample.dce.com\\data\\ping.json'
})
.then(function (res) {
$scope.gridOptions.api.setRowData(res.data);
});
但是,我收到以下错误
XMLHttpRequest 无法加载 file://sample.dce.com/data/ping.json。只有协议方案支持跨域请求:http、data、chrome、chrome-extension、https、chrome-extension-resource。
有人可以帮我展示如何使用ajax调用在前端获取服务器端文件(使用c#)
答: 暂无答案
评论
file:
\
/