Chained async calls.

by shriek

JavaScript

$.ajax({
    type: "GET",
    dataType: "jsonp",
    url: "https://rawgithub.com/sinkingshriek/raw/master/first.js",
    success: function(){
        console.log("Check the logs, please.");
    }
});

$(document).ajaxSuccess(function(ev, jqXhr, options){
    if(options.url.match("https://rawgithub.com/sinkingshriek/raw/master/second.js")){
        doSecond();
    }
});