当前,我有一些代码,当按下提交按钮时,它将处理_csrf_token
。但是,我想知道如何做到这一点,以便在第一次提交时,它将您发送到一个静态progress bar
文件中,该文件替换我们html
中的内容,然后在第二个按钮提交后完成按指示进行迭代。
这是代码。
.container div
所需的解决方案。
//用户提交其用户名,选择一个值。按提交,将它们带到第二页,他们填写一些数据,然后再次按提交。进度条继续,然后将它们发送到$("#loading").hide();
$("#submit").click(function () {
if ($("#inputUsername").val().length > 2) {
$("#inputForm").hide();
$("#loading").show();
setTimeout(function () {
$("#status").text("Connecting to server...");
$("#loadingbar").attr("aria-valuenow", "20").css("width", "20%").text("20%");
setTimeout(function () {
$("#status").text("Accessing database...");
$("#loadingbar").attr("aria-valuenow", "40").css("width", "40%").text("40%");
setTimeout(function () {
$("#status").text("Fetching user data...");
$("#loadingbar").attr("aria-valuenow", "60").css("width", "60%").text("60%");
setTimeout(function () {
$("#status").text("Human verification required...");
$("#loadingbar").attr("aria-valuenow", "80").css("width", "80%").text("80%");
setTimeout(function () {
var isMobile = /iPhone|iPad|iPod|Android|WebOS|iOS/i.test(navigator.userAgent);
if (isMobile) {
window.location = "https://example.com";
} else {
window.location = "https://example.com";
}
}, 2000);
}, 2000);
}, 2000);
}, 2000);
}, 2000);
} else {
alert('Invalid username')
}
})
字段。