AJAX 每个表单元素?

发布于 2024-09-12 06:30:51 字数 91 浏览 0 评论 0原文

单独使用 AJAX 每个表单元素(例如发送 onChange 请求等)或收集所有数据,然后通过一键保存提交是否更好?

本质上是自动保存还是用户启动保存?

Is it better-practice to AJAX every form element separately (eg. send request onChange, etc) or collect all the data, then submit with 1 click save?

Essentially, auto-save or user-initiated-save?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

走走停停 2024-09-19 06:30:51

我通常会说,用户启动的保存是大多数 Web 应用程序的最佳选择。如果没有别的原因,这就是用户习惯与网络应用程序交互的方式;熟悉度和易用性在 Web 应用程序中极其重要。更不用说它可以减少不必要的流量。

这并不是说自动保存没有它的用​​武之地,但它常常会造成不必要的流量。例如,如果我自动保存联系表单,填写我的姓名,然后发送电子邮件,然后返回姓名进行更改,这已经发送了 3 个请求,但没有带来任何好处 - 这是额外的工作,没有任何额外的好处。

再说一遍,我认为这确实与您的应用程序或您计划使用它的位置有很大关系。内联编辑经常使用自动保存,我认为它很有用,而联系表单/注册表单不是一个好主意。

I would generally say that a user-initiated save is the way to go for most web-applications. If for nothing else, this is how users are used to interacting with web apps; familiarity and ease of use is extremely important in web applications. Not to mention it can cut down on unnecessary traffic.

This is not to say that auto-saving does not have it's place, but often it can be cause unnecessary traffic. For example, if I am auto-saving a contact form, fill out my name, then email, then back to name to change it, that is already 3 requests that have been sent with no benefit - this is extra work for no added advantage.

Once again, I think it does have a lot to do with your application or where you are planning on using it. Inline edits are something that often uses auto-saving and there I think it is useful, whereas a contact form/signup form would not be a good idea.

镜花水月 2024-09-19 06:30:51

我想说这取决于您的应用程序的性质以及“自动保存”是否是您的用户所需的行为。

“用户发起的保存”是用户对当今网络表单体验的期望 - 除非有充分的理由,否则我不会偏离这一点。

I'd say that depends on the nature of your application and whether "auto-save" is a behaviour desired by your users.

"User initiated save" is what a user would expect from their experience with web forms nowadays - I would not deviate from that unless there's a good reason.

爱你是孤单的心事 2024-09-19 06:30:51

取决于以下因素:

  1. 您想要保存什么类型的数据。例如,可以部分保存数据还是需要一次保存全部数据?
  2. 您想保存多少数据?如果您有许多字段,您可能希望以块的形式发送数据(在向导的情况下)或一次保存所有内容
  3. 如果用户可能需要,以临时方式保存大型表单的数据(在后台)也是一个好主意填写数据的时间很长(例如,保存为草稿的电子邮件)
  4. 它还取决于您的网络应用程序和您设计表单的方式。在某些表单中,您可以允许修改某些字段并将其保存到位,以便您可以获取其他数据,例如
  5. 在大多数情况下,为数据表单提供明确的“保存”操作会很好

Depends on following factors:

  1. What kind of data are you trying to save. E.g. is it okay to be able to save the data partly or you need to save it all at once?
  2. How much data do you want to save? If you have many fields, you might want to send data in chunks (In case of wizards) or save everything at once
  3. Its also a good idea to have data saved (in background) for large forms in a temp way if the user may take a long time to fill in the data (e.g. emails saved as drafts)
  4. It also depends on your web app and the way you have designed your forms. In some forms you may allow certain fields to be modified and saved inplace, so that you can fetch additional data for example
  5. In most cases it would be good to have an explicit "Save" action for your data forms
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文