this is my function
function checkuploadpincode(pin_check){
    var book = new Books('books/bookupload_pin_check/'+pin_check)
    book.fetch(function (data) {
      console.log(data);
      if(data.status==true){
        alert('service available');
        return true;
      }else{
        alert('Service not available.');
        return false;
      }
    },function(data){
      alert('Service not available.');
       return false;
    });
}
$('#continue1').click(function(){
    if($('#activeSchool').hasClass('active')){
      var school_pin_check = $("input[name=school_pin_check]").val();
      checkuploadpincode(school_pin_check);
      if(isbn==''){
        alert('ISBN field Required');
        return false;
      }
    }
});
need help when i run above script it execute checkuploadpincode() first then other condition. but it execute other then my function. i thing my function takes time to execute that's why other condition execute first. i need to run my function complete then bellow condition.
 
     
    