gpt4 book ai didi

javascript - onClick 将 'POST' 数据发送到 php 文件并获取结果

转载 作者:行者123 更新时间:2023-12-01 03:05:18 26 4
gpt4 key购买 nike

<script>
$(document).ready(function(){
$("#vE_rebtn").click(function{
var reverifyEmail = '<?php echo $_SESSION["verifyEmIPv"]; ?>';
$('#rE_rebtn').hide();
$('#re_verifyEMAIL-notice').hide();
$('#rE_resending').show();
$.ajax({
type: 'POST',
url: 'data/system/auth.php',
data: {verifyEMAIL: reverifyEmail},
success: function (data) {
console.log(data);
$('#verifyEMAIL_notice').hide();
$('#re_verifyEMAIL_notice').show();
}
});
});
});
</script>
<ul id="verifyEMAIL_notice" class="success-notification"><li>Email Has been sent, hurry you have only 5 minutes to verify your IP and activate your account.</li></ul><br />
<ul id="re_verifyEMAIL_notice" style="display:none;" class="success-notification"><li>Email Has been sent, hurry you have only 5 minutes to verify your IP and activate your account.</li></ul><br /><h3><p>Keep in mind. Do not close this window, until you verify yourself.<br />If time limit exceed you can request for new code from this page.</p><br />
<div id="vE_rebtn">Click To Resend Now!</div></h3>
<div id="vE_resending" style="display:none;">Resending.... Please Wait.</div></h3>

以上代码不起作用

I want to send form data from this page, this page receive form data in $_POST variables and I now want if someone click on Resend Code then jquery run and send this form data to another php page and get result from that page.

最佳答案

onclick 函数声明中缺少括号:

$("#vE_rebtn").click(function(){
// add this: ----------------^^

您的浏览器控制台应该告诉您当前代码存在无效语法。

除此之外,此代码应该可以很好地发送 $_SESSION["verifyEmIPv"] 的值当 <div id="vE_rebtn"> 到服务器时被点击。

关于javascript - onClick 将 'POST' 数据发送到 php 文件并获取结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46242873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com