Do anyone has similar experience? I found the jQuery didn't load the script in order. Below is the script I called, I have no idea what the sequence of the code be called. In code, the validation.js is called first and then the c_validation.js, but in the Chrome Javascript Console, the result of loading the script is inverted. Is it caused by the size of the script? How can I force the scripts be loaded one by one?
$("#tab-4-content").load("/reg.php?id="+this.id+"&ads="+$(this).data('ads')+"&f="+$(this).data('file')+"&mid="+$(this).data('mid')); var url = "http://mydomain.com/validation.js"; $.getScript(url) .done(function() { console.log( "Success load validation"); }) .fail(function() { console.log("Failed load validation"); }); var url = "js/c_validate.js"; $.getScript(url) .done(function() { console.log("Success load c_validate.js"); }) .fail(function() { console.log("Failed load c_validate.js"); }); $.mobile.changePage("#tab-4"); $("#terms").html("/dev/terms.inc.html"); }); // tab-3-content click XHR finished loading: GET "http://dev.mydomain.com/c_by_cat.inc.php?id=code". jquery.js:10306 http://mydomain.com/validation.js js.php?id=code:92 XHR finished loading: GET "http://dev.mydomain.com/js/c_validate.js?_=1405324184667". jquery.js:10306 Failed load c_validate.js js.php?id=code:106 XHR finished loading: GET "http://dev.mydomain.com/reg.php?id=3&ads=1&f=3.png&mid=2". jquery.js:10306 Success load validation
Scripttags?