const resumatorScript = document.currentScript //Condition to check if the script tag is inside the body or head tag. if(document.body && document.body?.contains(resumatorScript)) { //Reders the HTML below the script tag mentioned inside body tag resumatorScript.insertAdjacentHTML('afterend', `
`); insertResumatorWrapper(); } else{ //Reders the HTML ath the begining of the body tag window.onload = function() { const body = document.body; body.insertAdjacentHTML('afterbegin', ``); insertResumatorWrapper(); } } function insertResumatorWrapper(){ const resumatorWrapper = document.getElementById("resumator-wrapper"); resumatorScript.insertAdjacentHTML('afterend', ``) resumatorWrapper.insertAdjacentHTML('beforeend', ' ') resumatorWrapper.insertAdjacentHTML('beforeend', ``) } if (typeof window.jQuery === "undefined") {const jqueryScript = document.createElement("script");jqueryScript.type = "text/javascript";jqueryScript.charset = "utf-8";jqueryScript.src ="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";const noConflictScript = document.createElement("script");noConflictScript.type = "text/javascript";noConflictScript.appendChild(document.createTextNode("$.noConflict();"));const resumatorScript = document.currentScript;resumatorScript.after(jqueryScript);resumatorScript.after(noConflictScript);}