jQuery Ajax
AJAX stands for Asynchronous JavaScript and XML and this technology helps us to download data from the Server without Refreshing the browser.
If you feel new to AJAX, I suggest you visit the page: Ajax Tutorial before tracking what is mentioned in this chapter.
jQuery is a great tool that provides a rich set of AJAX methods for web application development.
Download data simply with jQuery
It is really easy to load any static or dynamic data using jQuery AJAX. jQuery provides a load () method to do this:
Syntax
The following is a simple syntax for the load () method in jQuery:
[selector]. load( URL, [data], [callback] );
Detailed description of the parameters:
URL - The Server-Side URL for the Request is sent. It can be CGI, ASP, JSP, or PHP script that generates dynamic data or exits the database
data - This optional parameter represents an object whose attributes are ordered in the appropriate parameters to be passed to the Request. If specified, Request is created using POST method. If ignored, the GET method is used.
callback - A callback function called after the response data has been loaded into the elements of the connected set. The first parameter passed to this function is the response text from the Server and the second parameter is status encoding.
For example
You consider the following HTML file with a small jQuery code:
The jQuery Example