Posted By

crypticsoft on 02/04/11


Tagged

ajax jquery


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

virendrakryadav
sjacunningham
czehner
jillella


Ajax Request


 / Published in: jQuery
 

URL: http://api.jquery.com/jQuery.ajax/

form method / url is pulled from the form dataType is set to json but can include the following: xml, json, script, or html

  1. $.ajax({
  2. type: $('form').attr('method'),
  3. url: $('form').attr('action'),
  4. data: {
  5. keyword: keyword
  6. },
  7. dataType: 'json',
  8. complete: function(){
  9. //alert('complete');
  10. },
  11. error: function(){
  12. //alert('error');
  13. },
  14. success: function(data){
  15. //alert('success');
  16. }
  17. });

Report this snippet  

You need to login to post a comment.