I\'m using the following bit of script to load another one:
$.getScript(\"CAGScript.js\", function () { try { CAGinit(); } catch(err) {
My way is
setTimeout(function(){ $.getScript( "CAGScript.js"); }, 2000);
this same issue we face in angular also when we want to update data in $scope and it is solved by using $timeout in same manner in angular...