There are number of ways to use Ajax in JQuery library

GET Oriented Method:
If you want Ajax activity either on load page, submit form, paging what ever. It depend on you
Use below code

$. get (“back.php”, {name1: “php”, name2: “interview”},
alert(“Data Loaded: ” + data);

back.php = back file need to call.
name1: “php”, name1: “interview” = values to send on back.php.
data = value which back.php will return.

Please see look on back.php

POST Oriented Method:

Please changes $.get to $.post in above code.

Third method:

This is third method to use Ajax using JQuery library.

  1. $.ajax({
  2. type: “POST”,
  3. Url: “back.php”,
  4. data: “name=php&location=India”,
  5. success:function (msg){
  6. alert( “Data Saved: ” + msg);
  7. }
  8. });
eXTReMe Tracker