Uncategorized

Loading multiple javascript files bằng jquery

$.when(
    $.getScript( "/mypath/myscript1.js" ),
    $.getScript( "/mypath/myscript2.js" ),
    $.getScript( "/mypath/myscript3.js" ),
    $.Deferred(function( deferred ){
        $( deferred.resolve );
    })
).done(function(){

    //Khi load xong các file js
});

Leave a Reply

Your email address will not be published. Required fields are marked *