easyui-ComboTree 获取json 报错405

Heerey525
前端领域新星创作者
2018-09-17 11:34:13


在服务器端,文件路径正确
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="easyui.css">
</head>
<body>
<input id="cc" class="easyui-combotree" multiple style="width: 190px;" panelHeight="300px">
<script src="layui/jquery-3.3.1.js"></script>
<script src="jquery.easyui.min.js"></script>
<script>
$('#cc').combotree({
url: 'event1.json',
});
</script>
</body>
</html>
...全文
181 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Heerey525 2018-09-17
  • 打赏
  • 举报
回复
$('#cc').combotree({
url: 'event1.json',
method:'get'
});
没看到method方法,已解决,结贴
Hello World, 2018-09-17
  • 打赏
  • 举报
回复
405是说请求的方法不允许,默认combotree的参数method是post,访问静态文件时很多服务器都会阻止,可以显示设置为get或者在服务器上设置为允许post,另外检查下json对应的MIME是否设置好了

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧