How to get information about end of execution some asynchronous method in javascript which dont provide this option

StackOverflow https://stackoverflow.com/questions/20721026

سؤال

How to get information about end of execution some asynchronous method in javascript which dont provide this option. Example: i use jtable library and need to know about time then method .jtable('load') will complete. Changing library code is unacceptable. What i am gonna do ?

هل كانت مفيدة؟

المحلول

Set a callback functon in .load:

$('#Table').jtable(
    'load',
    {
        cityId: 1,
        name: 'London',
        data: 'information'
    },
    function(){
        alert('.load function successfully completed');
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top