42 views

jQuery ajax

working with ajax in jQuery. Very simple and easy technique.
jQuery.ajax( options )

option may contain–>
type- type of data send {GET OR POST}.
url- location of file where data has to be send.
cache- if set to false then page is not cached by browser.
data- parameters passed to requested file.
success- what to do when request is succeeded.

  1.  
  2. $.ajax({
  3.    type: "POST",
  4.    url: "test.php",
  5.    cache: false,
  6.    data: "name=computer&location=us",
  7.    success: function(msg){
  8.      alert( msg );
  9.    }
  10.  });

Post a Comment

You must be logged in to post a comment.