Talking about the implementation of Ajax technology and the refreshing of pages; talking about the ajax technology page

Source: Internet
Author: User
Tags url example

Talking about the implementation of Ajax technology and the refreshing of pages; talking about the ajax technology page

Ajax (ajax Development)

AJAX is "Asynchronous Javascript And XML" (Asynchronous JavaScript And XML), which is a Web page development technology used to create interactive web applications.

AJAX = Asynchronous JavaScript and XML (subset of standard General Markup Language ).

AJAX is a technology used to create fast dynamic web pages.

By performing a small amount of data exchange with the server in the background, AJAX can implement asynchronous updates on webpages. This means that you can update a part of a webpage without reloading the entire webpage.

If you need to update the content of a traditional web page (without AJAX), you must reload the entire web page.

Currently, most websites use ajax to perform page refreshing.

What is no refreshing: ajax can achieve data interaction between pages and the background, and users cannot feel any page refreshing at all. This is the refreshing of AJAX.

Ajax implementation:

You can encapsulate ajax to facilitate calling of each page:

Function MyAjax (type, url, callBack, data, dataType, asyncType) {if (dataType = null) {dataType = "text";} if (asyncType = null) {asyncType = true;} $. ajax ({type: type, // post or get url: url, // it is best to add a url + Math. random (), which ensures that the page of each request is treated as different data: data by the browser. // here is the parameter to be passed, in the format of data: "{paraName: paraValue} "dataType: ype, // string, xml, script, json, textasync: asyncType, // synchronous asynchronous true/false error: function (XmlHttpRequest, xmlhttp, info) {}, success: function (result) {// callBack function, result, return value callBack (result );},});}

Call: MyAjax ('post', "url? Id = "+ id, DoOK );

Note: async: true indicates asynchronous. This means that when ajax sends a request, the foreground will continue to execute the script after the ajax block while waiting for the server to return, success will not be executed until the server returns a positive result, which is equivalent to opening two threads; false is synchronization, that is, the foreground will wait for the server to return data before execution.

With regard to the implementation of the Ajax technology with no refreshing page effects, I would like to introduce so much to you and hope to help you!

Articles you may be interested in:
  • PHP Ajax implementation page without refreshing comments
  • PHP Ajax implementation page without refreshing comments
  • JS + Ajax + Jquery implement the implementation of refreshing pages and grouping
  • No-refreshing Ajax Url submission page
  • The ajax page is not refreshed. The Ajax cache causes the data not to be updated.
  • Implement ajax-like page refreshing Based on iframe
  • Use ajax and history. pushState to refresh the page URL example
  • Use ajax to achieve no refreshing changes to the page content and address bar URL
  • Use the Yii integrated pjax (pushstate + ajax) to load the page without refreshing

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.