gpt4 book ai didi

javascript - 为什么我的 jquery 数据没有显示在我的 HTML 页面中

转载 作者:行者123 更新时间:2023-11-28 04:07:03 24 4
gpt4 key购买 nike

我是 javascript 新手,这让我很困惑。我没有编写这段代码,但我当然需要它才能工作!问题是信息没有显示在我的 <p> 中标签。一切似乎都正常,直到我到达 var hint_result 。但我只是不知道为什么信息不显示。试图爱上 javascript,但很挣扎:)它应该显示密码提示。这是发回内容的示例:

{"CONDITION":"true","MESSAGE":"top of the fruit","UUID":"1851-CCC6-A8A80A1B148637C6"}

代码:

<!--- Password Hint Window Start --->
<div class="password_hint">
<p>Forgot your password?<br />No problem... we can fix that!</p>

<div class="hint_form">
<p>Enter your email address</p>
<form method="post">
<input placeholder="Email_address" name="password_hint_email_address" type="text" tabindex="1" />
<p class="button small passwordHint" style="width: 100%; margin: 1px 0 10px;" tabindex="2" >Submit</p>
</form>
</div>

<!--- Error Messages --->
<p class="hint_result"></p>
</div>


(function() {
$("p.button.small.passwordHint").click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: globalURL+"/myfolder/userlogin.cfc?" + url_params,
data: {
method: "PasswordHint",
email: $("input[name='password_hint_email_address']").val()
},
success: function(hint) {
var hint = jQuery.parseJSON(hint);

if (hint.CONDITION == true) {
var hint_result = $("p.hint_result").html("Your password hint is \"" + hint.MESSAGE + "\"").addClass(" messageSuccess");
$(hint_result).show("slow");
} else if (hint.CONDITION == false) {
var hint_result = $("p.hint_result").html(hint.MESSAGE).addClass(" messageError");
$(hint_result).show("slow");
}
},
error: function(e) {
// handle error
//alert("Sorry there has been an error");
}
});
});
}());

提前致谢。

最佳答案

您的代码 <script>您应该尝试将此标记放入您的代码中。

关于javascript - 为什么我的 jquery 数据没有显示在我的 HTML 页面中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46609138/

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