Tuesday, March 20, 2012

callback example

What follows is from this training.

$(function () {
   $('#showAttendees').click(function () {
      var url = '@Url.Action("Show", "Attendee", new { confname = Model.Name })';
      var button = $(this);
      var callback = function (data, textStatus) {
         $('#attendees').html(data);
         button.hide();
      };
      $.get(url, null, callback, 'html');
   });
});

 
 

Remember Tom, this is called a callback and NOT a postback. Duh.

No comments:

Post a Comment