$('#in-view-contents').load("/browse/".concat(selectedId), function(responseData){
var contentsLabelEl = document.getElementById("refined-contents-container");
contentsLabelEl.style.display = "block";
var arrayOfReloadScripts = ["/js/rateable.js", "/js/siteWide.js", "/js/search/searchEvents.js"];
reloadScripts(arrayOfReloadScripts);
});
and reloadScripts just iterates though the array and calls this function:
function reload_js(src) {
$('script[src="' + src + '"]').remove();
$('<script>').attr('src', src).appendTo('head');
}
Does this cause jquery to make an synchronous call like explained in this SO answer? If not how do I rerun a set of functions that I need to run once the html/server response is loaded?
EDIT: Here is the code for reloadScripts:
var reloadScripts = function(array){
var len = array.length;
for (var i = 0; i < len; i++){
reload_js(array[i]);
}
}