jQuery插件冲突 - 请协助

2023-01-26前端开发问题
6

本文介绍了jQuery插件冲突 - 请协助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

目的是显示一个表单,该表单将使用结果更新页面上的 div

The aim is to show a form which will update the div on the page with the result

  1. 加载此 [页面]
  2. 点击链接显示表格
  3. 提交表格

提交时,如果表单被隐藏,结果不会显示在 div 中.

When submitting, the result does not show in the div if the form had been hidden.

  • 添加以下答案中建议的代码后,我显示表单,它被提交,但数据没有出现在 div 中我将 ajaxForm 作为目标

  • after adding the code suggested in the below answers, I show the form, it gets submitted, but the data is not appearing in the div I give the ajaxForm as target

[Here] 与在 div 中显示结果的形式相同

[Here] is the same form that does show the result in the div

谢谢

推荐答案

当你提交表单时,请求被发送到服务器,你得到一个 HTTP 错误:405 Method Not Allowed.

When you submit the form, the request is sent to the server and you obtain a HTTP Error: 405 Method Not Allowed.

看起来它来自您服务器的配置.http://www.checkupdown.com/status/E405.html

It looks like it comes from the configuration of your server. http://www.checkupdown.com/status/E405.html

由于您的代码适用于 facy.html 页面中的示例,我认为它并不是真正来自服务器.两个例子的区别在于表单的action.

as your code works for your example in the facy.html page I think it doesn't really comes from the server. The difference between the two examples are the action of the form.

  • fancy.html:加载一个 PHP 文件
  • fancy3.html:加载一个 HTML 文件

您是否尝试将您的 thank you 页面称为thanks.php"并相应地修改表单的 action.我想您的服务器可能不允许 HTML 页面上的 POST 请求.

Did you try to call your thank you page "thanks.php" and modify the action of your form accordingly. I suppose that your server might not allow POST request on an HTML page.

这篇关于jQuery插件冲突 - 请协助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

ajax请求获取json数据并处理的实例代码
ajax请求获取json数据并处理的实例代码 $.ajax({ type: 'GET', url: 'https://localhost:44369/UserInfo/EditUserJson',//请求数据 data: json,//传递数据 //dataType:'json/text',//预计服务器返回的类型 timeout: 3000,//请求超时的时间 //回调函数传参 suc...
2024-11-22 前端开发问题
215

layui 单选框、复选框、下拉菜单不显示问题如何解决?
1. 如果是ajax嵌套了 页面, 请确保 只有最外层的页面引入了layui.css 和 layui.js ,内层页面 切记不要再次引入 2. 具体代码如下 layui.use(['form', 'upload'], function(){ var form = layui.form; form.render(); // 加入这一句});...
2024-11-09 前端开发问题
313

layui中表单会自动刷新的问题
layui中表单会自动刷新的问题,因为用到layui的表单,遇到了刷新的问题所以记录一下: script layui.use(['jquery','form','layer'], function(){ var $ = layui.jquery, layer=layui.layer, form = layui.form; form.on('submit(tijiao)', function(data){ a...
2024-10-23 前端开发问题
262

jQuery怎么动态向页面添加代码?
append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href...
2024-10-18 前端开发问题
125

Rails 3.1 ajax:成功处理
Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)...
2024-04-20 前端开发问题
11

ExecJS::ProgramError: SyntaxError: 保留字“function"
ExecJS::ProgramError: SyntaxError: Reserved word quot;functionquot;(ExecJS::ProgramError: SyntaxError: 保留字“function)...
2024-04-20 前端开发问题
13