您的当前位置:首页正文

Blocked form submission to ‘‘ because the form‘s frame is sandboxed and the ‘allow-forms‘ permission

2024-11-10 来源:个人技术集锦

Blocked form submission to ‘’ because the form’s frame is sandboxed and the ‘allow-forms’ permission is not set.

表单中有两个按钮,一个提交按钮,一个是查询按钮,点击查询按钮就报错

 <button  class="layui-btn layui-btn-sm layui-btn-danger" onclick="search()"><i class="layui-icon">&#xe615;</i> 查询</button>

没有给button设置type,自动默认为submit类型,这并不是我想要的,查询按钮是用来ajax异步请求获取后端数据的,并不用提交。

改为

<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="search()"><i class="layui-icon">&#xe615;</i> 查询</button>
Top