失控的脚本?

My javascript is set up like -

function UpdateLevelRemove() {
  //Do something
    var ajaxCall = $.ajax({ data: { Svc: cntnrRoot,
        Cmd: 'updateLEvel',
        updatePrivacyAction: 'Remove'
    },
        dataType: "text",
        context: this,
        cache: false
    });

    $.when(ajaxCall).then(function () {
        updateLevelRemoveSuccess(recordID)
    });    
}

function updateLevelRemoveSuccess(recordID) {
    //Do something

    __doPostBack('', null);
}

I feel like every time I call a function with this structure, my process slows down and I get a "Stop running script?" error.

Am I on the right path or is there something I could add to stop that script? Like handle .done or .always?

There is an infinite loop somewhere in the script

Firebug has a 'break on script running' toggle button that you can click and break on a running script. After breaking just keep stepping through until you find the bug or the loop.

You can also try running the firebug profiler to see which functions are being executed.