jQuery Ajax request


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(function(){
  2. $('#myajaxbutton').click(function(){
  3. $.ajax({
  4. url: '/index/dosomething',
  5. type: 'POST',
  6. data { givemethis : 'IT WORKS!' },
  7. dataType: 'json',
  8. success: function(msg){
  9. alert(msg.val);
  10. }
  11. });
  12. });
  13. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.