What are the four parameters used for jQuery Ajax method?

Prem Tiwari - - Jquery


One of my site visitor asked this question via email so that I am going to what are the four parameters used for jQuery Ajax method call. We need to add four mandatory parameter while doing  Ajax call using PHP and jQuery.

Following are the list of those four parameters:

  1. URL – Need to specify the URL to send the request
  2. type – Specifies type of request(Get or Post)
  3. data – Specifies data to be sent to server
  4. Cache – Whether the browser should cache the requested page

The jQuery library provides a few different methods to perform AJAX calls, although here we’ll look at the standard ajax method, which is the most often used.

Take a look at the following example.

Ajax call using PHP and jQuery example

Below is the complete example of Ajax call using PHP and jQuery.

 


Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.