当应HTTP表单POST是pferred超过阿贾克斯$ P $? [英] When should HTTP Form POST be preferred over Ajax?

查看:110
本文介绍了当应HTTP表单POST是pferred超过阿贾克斯$ P $?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用AJAX。在此之前,我已经主要用于表单提交的数据发送到服务器。但是,使用AJAX,我觉得我就能够避免表单提交,在大多数的情况下。即使在这些情况下,我们需要从一个页面转到另一个页面(例如,如果我想看到的点击表的客户联系的特定客户的细节,我可以让Ajax调用服务器,并得到HTML的响应,并追加它目前的网页,其中较早的直通表单提交这是有点慢也)被处理。

I have recently started using ajax. Before that i have primarily used form submission to send the data to server. But with using ajax, i feel like i we can avoid form submission in most of the cases. Even in those case where we need to go from one page to another page(for example if i want to see the detail of particular customer on click of customer link in table, i can make ajax call to server and get the html response and append it on current page which earlier was handled thru form submission which was bit slow also).

所以,我想知道的东西在这里提交表单应该pferred阿贾克斯$ P $?

So i would like to know the stuff where form submission should be preferred over ajax?

推荐答案

大多数情况下,阿贾克斯都可以使用。但请记住,它需要实施额外的工作。

Mostly, Ajax can be used. But keep in mind that it requires additional effort in implementation.

此外,有一对夫妇的情况下,其中仍需要形式:

Also, There are a couple of cases where forms are still needed:

  • 文件上传
  • 将数据发送到其他服务器
  • 在一种形式,触发下载

这篇关于当应HTTP表单POST是pferred超过阿贾克斯$ P $?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆