我有一个页面,其中多个表单由数据库动态创建,表单的目的是将一些数据提交给webhook以驱动API调用。
我已经将所有论坛拖了几天,但没有找到解决我问题的方法 - 这让我发疯了!以下是工作代码 - https://jsfiddle.net/Richyc84/bkmLcauv/
这表明我的代码正在运行,每个按钮都以正确的值提交给webhook。但是,当我将代码放在我的网站上时(例如此处 - http://www.bouncepost.co.uk/zapiertest/),表单会提交,但都没有数据或空白数据。
如果有人可以提供帮助,我将非常感谢您的支持! (下面的html和jQuery代码)。
jQuery('.mediainfo').submit(function(event) {
event.preventDefault();
var clipid = jQuery(this).serialize()
jQuery.ajax({
url: 'https://hooks.zapier.com/hooks/catch/641301/azvo2c/',
type: 'post',
data: clipid,
success: function() {
//whatever you wanna do after the form is successfully submitted
jQuery('.modal').modal('hide');
alert(clipid);
}
});
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<div>
<div class="row">
<button style="font-size:15px;width:100px;white-space:normal;padding:
0px 0px;" data-toggle="modal" data-target="#mediainfo1">Update
MediaInfo1</button>
</div>
</div>
<div class="modal fade" id="mediainfo1" data-toggle="mediainfomodal">
<div class="modal-dialog" style="z-index: 1100;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria- hidden="true">×</button>
<h4 class="modal-title">Update MediaInfo</h4>
</div>
<div class="modal-body">
<p>Update MediaInfo for clipid 1?</p>
</div>
<div class="modal-footer">
<form id="form1" class="mediainfo"><input type="hidden" name="clipid" value="clip1"><input type="submit" value="Confirm" style="font-
size:15px;width:100px;white-space:normal;padding: 0px 0px;">
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div>
<div class="row">
<button style="font-size:15px;width:100px;white-space:normal;padding:
0px 0px;" data-toggle="modal" data-target="#mediainfo2">Update
MediaInfo2</button>
</div>
</div>
<div class="modal fade" id="mediainfo2" data-toggle="mediainfomodal">
<div class="modal-dialog" style="z-index: 1100;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria- hidden="true">×</button>
<h4 class="modal-title">Update MediaInfo</h4>
</div>
<div class="modal-body">
<p>Update MediaInfo for clipid 2?</p>
</div>
<div class="modal-footer">
<form id="form2" class="mediainfo"><input type="hidden" name="clipid" value="clip2"><input type="submit" value="Confirm" style="font-
size:15px;width:100px;white-space:normal;padding: 0px 0px;">
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
答案 0 :(得分:0)
你应该看看控制台:
;security.limit_extensions = .php .php3 .php4 .php5
Thera也是加载精细上传器插件的混合内容的问题:
Uncaught ReferenceError: jQuery is not defined