title: Javascript callback function inside ajax
body: <p>how would i do this?</p>
  
  <pre><code>function DoStuffAndCallBack(callback){
        $.get( "ajax/test.html", function( data ) {
        callback();
  
      });
  }
  
  DoStuffAndCallBack(DoneFunction);
  
  function DoneFunction(){
    console.log('done stuff');
  }
  </code></pre>
  
  <p>I am getting 'callback' as undefined.Is there a way to do this, i know there are promises and what not but how can i do this in this instance.</p>