function loadScript(url, callback){ var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyState == "loaded" || script.readyState == "complete"){ script.onreadystatechange = null; callback(); } }; } else { //Others script.onload = function(){ callback(); }; } script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } CLIENT_KEY = 'ededcb9f-f308-4021-ad3a-e14025d085ff'; START_ROUTE = 'crossbooking'; START_ARGS = '?serviceCode=242'; loadScript("http://cdnjs.cloudflare.com/ajax/libs/headjs/1.0.3/head.min.js",loadWidget); function loadWidget() { head.load( "http://dental.appointmentor.com/styles/vendor.38b041f8.css","http://dental.appointmentor.com/styles/main.f647bd8a.css", "http://dental.appointmentor.com/scripts/vendor.162e2fef.js", "http://dental.appointmentor.com/scripts/scripts.5c9c5294.js", "http://dental.appointmentor.com//js/jquery.raty.min.js", function () { }); }