I have two javascript functions
function one () { do something long... like writing jpgfile on disk } function two () { do something fast... like show
Try this,
$.when($.ajax(fuction1())).then(function () { fuction2; });
Here fuction1 is your first function to call, and fuction2 is your second function.