gpt4 book ai didi

javascript - 商业催化剂: Is it possible to submit the Password Retrieve Request form and display the resulting Password Retrieve Conformation page via AJAX?

转载 作者:行者123 更新时间:2023-12-02 15:44:23 28 4
gpt4 key购买 nike

我希望简化网站用户在 Adob​​e Business Catalyst 网站上注册、登录和检索/重置密码的流程。

我已成功使用 AJAX 提交安全区登录表单。我还使用 jQuery.load 从密码检索请求系统页面获取 HTML 并将其插入我的登录页面,这样用户就不必离开该页面来检索密码。

下一步我想做的是通过 AJAX 提交密码检索请求表单,并阻止浏览器加载默认加载的页面 (mysite.com/_System/SystemPages/PasswordRetrieveConfirmation) 但使用 AJAX 获取该页面上的数据并将其显示在当前页面上。

这可能吗?

密码找回请求页面及对应表格如下:

<div class="system-message">

<h3>Forgot Password?</h3>

<p id="tokenExpiredMessage" class="error {tag_tokenExpired}">ERROR: Your password reset token has expired. Please request a new one by filling in the form below.</p>

<p id="invalidUsernameMessage" class="error {tag_invalidUsername}">ERROR: The email address or username you provided does not exist.</p>

<p>Enter your email address or username below and we'll send you instructions on how to reset it.</p>

<form action="/LostPasswordProcess.aspx" method="post" name="catseczonelpform" id="lost-password-form">

<input type="text" maxlength="255" id="SZUsername" name="Username" class="cat_textbox_small" placeholder="Email Address / Username" />

<input type="submit" value="RETRIEVE" class="cat_button" />

</form>

</div>

我假设处理全部发生在服务器端,因为我没有看到任何 JS。

最佳答案

端点是 /LostPasswordProcess.aspx,它需要一个带有一个字段的 POST 请求:用户名

这是我的做法(为简洁起见,使用 jQuery):

var pwResetRequest = $.post(
'/LostPasswordProcess.aspx',
{ Username: 'ClementMandragora' }
);

pwResetRequest.then(function (response, textStatus, jqXHR) {
// do your thing with the response html
});

请注意,我们对响应 header 的访问权限有限,因此以编程方式判断重置请求是否成功似乎需要解析响应。

关于javascript - 商业催化剂: Is it possible to submit the Password Retrieve Request form and display the resulting Password Retrieve Conformation page via AJAX?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32323484/

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