Ajax may not be a strange thing for us, but if you are a Cross-domain request, then Ajax has nothing to do, in fact this can be made up, is the use of JSONP. In fact, is not what technology, but the use of JS tags in the cross-domain characteristics
New station's message board added a penthouse function, do not know you have used it?
In the beginning, I did not appear in the test when the problem, the specific questions below analysis, here first grumble.
Tonight, idle boring, and thinking
First look at the success of the effect of the chart
Before clicking
After clicking
A friend will say this effect with JS can also be achieved, but I do not understand JS so it is only in this way
HTML page (note the ID in the page)
Jquery.get (URL, [data], [callback]): Asynchronous request using Get method
This is a simple GET request function to replace the complex $.ajax. Callback functions can be invoked when the request succeeds. If you need to perform a function when an
Submit a Form $get way
The Get () method loads information through a remote HTTP GET request
Format
$ (selector). Get (Url,data,success (RESPONSE,STATUS,XHR), DataType)
Request test.php Web page, transfer 2 parameters, ignore return value:
JS Part *******/
t//here calls the Prototype.js package, $ ("AA") equivalent to document.getElementById ("AA");JS section. First invoke the AJAX application of prototype
The code is as follows
Copy Code
function
jquery Ajax Application Instance code/*Ajax sends data to a page$.post (' save.cgi ', {Text: ' My string ',Number:23}, function () {Alert (' Your data has been saved. ');});
If you do need to write some complex Ajax scripts, you need to use the
ExtJS ExtJS (Yui-ext) is a group of extensions from Yahoo! UI, a CS-style Web user interface component. The main UI includes: Dialog,grid,layout,tabs and so on.
jquery jquery is a fast, concise JavaScript toolbox that lets you manipulate HTML
Ajax. innerHTML Processing
JavaScript code Analysis
First of all, this needs to be sent three times, so we write the reusable code into a function, the task of which is to set the XMLHttpRequest object and initialize the necessary attributes. The
Ajax has two ways of submitting data, get and post, respectively. The Post method can transmit data larger than 2K, and the application in Ajax differs in that the "POST method's request address and the transmitted data are placed in two
Ajax asynchronously invokes a data instance
Through Ajax in the client call back code, through the background code changes, repair, query data, and return the results to the client, in the client to get the data returned by the server to do the
Ajax pagination Tutorial The front-end code, the HTML part we do not speak. Start the contents of the script directly. First we define 4 global variables, respectively:
All_page: Total pages, basis for creating page numbersAll_record: Total number
If you use a servlet, addResponse.setcontenttype ("text/html;charset=gb2312");Request.setcharacterencoding ("gb2312");And a better way is to add a filterin which to joinResponse.setcontenttype
With jquery, ajax has become quite simple.However, for simplicity, you may not need to load a huge js plug-in such as jquery in the project.But what should I do if I want to use ajax?Before implementing ajax, you must create an XMLHttpRequest object.
1. Which two AJAX methods are available?1.1. Official method The main idea is:Add wp_enqueue_script and wp_localize_script in functions to add the AJAX request address and call script. For example:$ AJAX = array('URL' => admin_url ('admin-ajax. Php '
Enter Baidu to search for the problem and find someone saying thisThe default value of async in Ajax in Jquery is true (asynchronous request). If you want to execute another Ajax after Ajax is executed, you need to set async to false.At that time, I
You can use jquery ajax to submit a form request.Jquery download function: The code is as follows: Copy code // Download an Ajax fileJQuery. download = function (url, data, method ){//
For example, if you click "Change" next to the logo on each page of this site, ajax will dynamically load one, using the built-in ajax method of wordpress. The following describes how to use the built-in ajax method of wordpress:1. Add html and js
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