用JavaScript检测PHP形式的XHR进度

发布于 2025-01-27 12:23:00 字数 358 浏览 1 评论 0原文

我在提交上提交此表格上有一个带有Action PHP的表格,

<form method="POST" action="action.php">
  <input type="text" name="name" />
  <input type="submit" value="submit" />
</form>

将加载执行请求时的页面;

我想要的是JavaScript,以检测请求的进度,以向用户显示其提交表格为n%;因为如果我的PHP有很大的待遇,则用户将不知道他的形式的进度在哪里;如果使用AJAX,我们可以捕获请求的进度,但是只有PHP表格的情况,我不知道如何捕捉进度

I have a form with action php on submit

<form method="POST" action="action.php">
  <input type="text" name="name" />
  <input type="submit" value="submit" />
</form>

this form on submit will load the page on executing the request;

What i want is with javascript, to detect the progress of the request to show user that his submit form is at N %; cause if i have a big treatment in my php, the user will not know where is the progress of his form; if using ajax we can catch the progress of request but with the case of only php form, i have no idea on how to catch the progress

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文