Ajax vs. traditional ASP Brushless new technology

Source: Internet
Author: User
Tags end error handling
ajax| Refresh | no refresh


What is the advantage of Ajax technology, do not understand. To see the simplest example, assume that when the user registers, to determine whether the user entered the name has been occupied, assuming that the input number 1: "OK" (indicating that the correct, you can use); Enter additional characters: "Error" (indicating errors, already occupied).

Using AJAX technology to achieve

Code: t.htm


1: Show "OK"; Other characters: Display ' Error '




Code:

T.asp
<%
Response.contenttype= "Text/xml"
If Request.QueryString ("t1") = "1" Then
Response.Write (" ")
Else
Response.Write (" ")
End If
%>

Traditional brushless new technology of ASP

Code t.htm


1: Show "OK"; Other characters: Display ' Error '




Code t.asp

<%
If request.querystring= "" Then Response.End
Ss= "ERROR"
If Request.QueryString ("t1") = "1" then ss= "OK"
%>

Both are no Refresh Extraction server (database) data and real-time display in the customer segment, then why do you now have to use Ajax, but also to consider the Chinese coding problems. Ajax in the end where the good, please tell me in detail, I was a little, but did not understand the beauty of Ajax.

Here, we only discuss the Ajax invoke the same domain under the ASP file (that is, write their own ASP program), the Thief program, steal news, weather forecasts and other applications are not discussed at the moment
, the example is very simple, no error handling, and so on, only for discussion.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.