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.