0

数据表没有从 json 文件中获取数据,我不知道如何修复,它显示 404 错误,文件访问错误

   $(document).ready(function() {

   $('#example').dataTable( {

   "ajax": "data.json"

   } );

   } );

 </script>

/---------------------------------------------------- ----------/

{
"data": [
   [

  "Tiger Nixon",
  "System Architect",
  "Edinburgh",
  "5421" 
],
[
  "Garrett Winters",
  "Accountant",
  "Tokyo",
  "8422"
],
[
  "Ashton Cox",
  "Junior Technical Author",
  "San Francisco",
  "1562"
   ]
]
}
4

1 回答 1

0

最后我自己修复了它,我在 wordpress 中这样做,wordpress 不接受 .json 扩展名,所以我将文件扩展名更改为 .text 并给它相对路径 -

于 2015-07-01T08:55:31.487 回答