title: How do I write a jquery function that accepts a callback as a parameter
body: <p>I Have the following function. </p>
  
  <pre><code>function ChangeDasPanel(controllerPath, postParams) {
  
      $.post(controllerPath, postParams, function(returnValue) {
  
          $('#DasSpace').hide("slide", { direction: "right" }, 1000, function() {
  
              $('#DasSpace').contents().remove();
  
              $('#DasSpace').append(returnValue).css("display", "block");
  
              $('#DasSpace').show("slide", { direction: "right" }, 1000);
  
          });
  
      });
  
  };
  </code></pre>
  
  <p>But I want to be able to call it like this</p>
  
  <pre><code>ChangeDasPanel("../Home/Test", {} ,function (){
    //do some stuff on callback
  }
  </code></pre>
  
  <p>How can I implement support for callbacks in my function?</p>