【发布时间】:2014-01-08 04:18:48
【问题描述】:
我不断收到 403 禁止错误,我根本无法获取我的 json 数据...这是我的 html 源代码:
<html>
<head>
<meta name="keywords" content="jquery,ui,easy,easyui,web">
<meta name="description" content="easyui help you build your web page easily!">
<title>jQuery EasyUI Demo</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
</head>
<body>
<h1>TreeGrid</h1>
<script>
(function(){
$.getJSON("data/data.json", function(data){
console.log(data); // i am not getting data here
});
})();
</script>
</body>
</html>
url 的路径是正确的。我得到的错误是:
GET http://localhost/~xxxxxx/dataTest/data/data.json 403 (Forbidden)
我该如何解决这个问题?
【问题讨论】:
-
当您尝试直接访问localhost/~xxxxxx/dataTest/data/data.json 时会发生什么?
-
也许这个链接会帮助403 forbidden error jquery EasyUI
-
对不起,我是这样的:禁止您无权访问此服务器上的 /~xxxxx/dataTest/data/data.json。 Apache/2.2.24 (Unix) DAV/2 PHP/5.3.26 与 Suhosin-Patch 服务器在 localhost 端口 80