Penam
// load styles var custom_style = document.createElement("link"); custom_style.href = "http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"; custom_style.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(custom_style); var custom_style = document.createElement("link"); custom_style.href = "https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css"; custom_style.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(custom_style); // load scripts which needs jQuery const checkJquery = function () { if (typeof jQuery === "undefined") { setTimeout(checkJquery, 500); } else { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.js"; document.getElementsByTagName("head")[0].appendChild(script); } }; checkJquery();