Jquery Ajax - Use event within an ajax callback function : <p>Any clues, how I would get this to work?</p>

<pre><code>$( "#search_form" ).on('submit',function(event) {


ajax(function(response){
    if (response.status == 'error'){
      event.preventDefault();
      alert(response.status,response.msg);
    }else if(response.status == 'ok'){
      alert(response.status,response.msg);
    }
  });
});
</code></pre>

<p>event.preventDefault(); is not being called, probably because it's out of scope in the ajax function.
This line simply prevents the button from carrying out a post action.
How would i insert it into the ajax function? I'm just learning about callbacks and this has thrown me</p>

<p>Thanks y'all</p>
