if(typeof jQuery=='undefined') { var headTag = document.getElementsByTagName("head")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'; jqTag.onload = setFileManager(); headTag.appendChild(jqTag); } else { setErrorMsg(); } function setErrorMsg(){ alert("URL is not allowed"); }