Return to Snippet

Revision: 51177
at September 16, 2011 04:21 by flipace


Updated Code
$(function(){
  $('#myajaxbutton').click(function(){
    $.ajax({
      url: '/index/dosomething',
      type: 'POST',
      data { givemethis : 'IT WORKS!' },
      dataType: 'json',
      success: function(msg){
         alert(msg.val);
      }
    });
  });
});

Revision: 51176
at September 16, 2011 04:19 by flipace


Updated Code
$(function(){
  $('#myajaxbutton').click(function(){
    $.ajax({
      url: '/controller/dosomething',
      type: 'POST',
      data { givemethis : 'IT WORKS!' },
      dataType: 'json',
      success: function(msg){
         alert(msg.val);
      }
    });
  });
});

Revision: 51175
at September 16, 2011 04:18 by flipace


Initial Code
$(function(){
$('#myajaxbutton').click(function(){

$.ajax({
  url: '/controller/dosomething',
  type: 'POST',
  data { givemethis : 'IT WORKS!' },
  dataType: 'json',
  success: function(msg){
     alert(msg.val);
  }
});

});

});

Initial URL


Initial Description


Initial Title
jQuery Ajax request

Initial Tags


Initial Language
jQuery