【问题标题】:Why i keep getting 403 forbidden issue?为什么我不断收到 403 禁止问题?
【发布时间】: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) 

我该如何解决这个问题?

【问题讨论】:

标签: jquery ajax json


【解决方案1】:

尝试将文件放在根文件夹中,然后访问它。它将帮助您排除在根文件夹下没有访问权限的问题。

【讨论】:

  • 我试过你的方法,它有效!那是什么问题,我无法从嵌套文件夹访问?
猜你喜欢
  • 2014-11-18
  • 1970-01-01
  • 2016-06-05
  • 2022-01-07
  • 2011-11-24
  • 1970-01-01
  • 2014-02-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多