调用和结束ajax函数

When I call ajax function such

 $(save_Data()).ajaxStop(function()
     {
        new_Form(code);
     }


 function save_Data()
   {
      // here send data to php and save it
   }

Now, I call another ajax function such

  $(get_Data()).ajaxStop(function()
       { 
             // doing some thing
       }


  function get_Data()
   {
      $.ajax
        ({
            type: 'POST',
            url: 'insert_Stock.php',
            data: { insert_Data : inserted_Data },
            dataType: 'json',
            success:function(data)
                {
                   // doing some thing such call another function to control on form
                }
        });
   }

When I call save_Data function already new_Form function execute, after that when I call get_Data function the new_Form function execute automatically. Why new_Form function execute?

If I understood you this is what you want.

function doSomething(){
  //your code here if success
}

function doSomethingElse(){
  //your code here if error
}

function finallyDoSomethingElse(){
  //your code here no matter what is the result of post
}

$.ajax({
    type: 'POST',
    url: 'insert_Stock.php',
    data: { insert_Data : inserted_Data },
    dataType: 'json',
    success: doSomething,
    error: doSomethingElse,
    complete: finallyDoSomethingElse
});