请问贴
请教贴 :
用form表单直接提交数据和用JS异步提交有什么不同?
------解决方案--------------------
form表单直接提交数据和JS异步提交数据没关系呀,各自提交各自的~~
你是说同步和异步提交的区别吧,其实他们也就那样,只不过异步提交可以实现页面无刷新效果而已。。
不对之处,求高手指点~~
------解决方案--------------------
表单(form)提交与AJAX提交适用的场合
1、表单提交(form)
1)、比较适合提交用户输入信息量比较大的场合。
2)、表单提交的可靠性相对比较好一些。
2、AJAX提交(异步请求)
1)、表单驱动的交互
在传统的表单提交中,如果想验证一下用户所输入信息的正确性就需要提交表单进行后端程序的验证;而此时用户所面对的就是一个白屏,生硬无趣!通过AJAX可以很好的改变这用户体验。
2)、树结构的导航
在表单提交中,如果想要展开某个结点树下的内容就需要进行一次表单提交,但这样就又出现了第一种情况所出现的问题。如果用AJAX可以解决响应速度,不重载页面以及避免向服务器频繁发送请求的问题。
3)、对数据进行过滤和操纵相关数据的场景
如果用户向服务器端发送了一个请求,服务器端可以给我们返回一个以json或是XML格式的信息。我们可以通过对这些返回进行过滤,以找到我们所需要的信息数据。
4)、自动完成功能
如:google和百度首页的自动完成功能(Auto Complete)
5)、替换大量折文本
使用AJAX来替换局部信息是一件不错的办法而且效果也比较直观。但是如果要用其来替换页面中大量的信息,那还不如做一次重新请求来完成。
参考原文:http://www.cntxk.com/CataNews/35/info11448.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Currently, four new Pixel smartphones are anticipated to land this autumn. To recap, the series is rumoured to feature thePixel 9 and Pixel 9 Pro at launch. However, the Pixel 9 Pro will be a rival to the iPhone 16 Pro rather than a Pixel 8 Pro (curr

Google has introduced DisplayPort Alternate Mode with the Pixel 8 series, and it's present on the newly launched Pixel 9 lineup. While it's mainly there to let you mirror the smartphone display with a connected screen, you can also use it for desktop

Google recently responded to the performance concerns about the Tensor G4 of the Pixel 9 line. The company said that the SoC wasn't designed to beat benchmarks. Instead, the team focused on making it perform well in the areas where Google wants the c

Google AI has started to provide developers with access to extended context windows and cost-saving features, starting with the Gemini 1.5 Pro large language model (LLM). Previously available through a waitlist, the full 2 million token context windo

Google's AI assistant, Gemini, is set to become even more capable, if the APK teardown of the latest update (v15.29.34.29 beta) is to be considered. The tech behemoth's new AI assistant could reportedly get several new extensions. These extensions wi

The Pixel 9 series is almost here, having been scheduled for an August 13 release. Based on recent rumours, the Pixel 9, Pixel 9 Pro and Pixel 9 Pro XL will mirror the Pixel 8 and Pixel 8 Pro (curr. $749 on Amazon) by starting with 128 GB of storage.

A few months have passed since Android Authority demonstrated a new Android desktop mode that Google had hidden away within Android 14 QPR3 Beta 2.1. Arriving hot on the heels of Google adding DisplayPort Alt Mode support for the Pixel 8 and Pixel 8

Google is roughly a fortnight away from fully revealing new hardware. As usual, countless sources have leaked details about new Pixel devices, whether that be the Pixel Watch 3, Pixel Buds Pro 2 or Pixel 9 smartphones. It also seems that the company
