How you need to dynamically import JS files, the following methods may help you
When we want to do dynamic import JS file, we can use the following method code as follows: var docfunc = { /**************************************** * Purpose: Invoke the following dynamic load script method load_script ****************************** / loaddefjquery:function () { //alert ( Ucapsession.hostpath + ucapsession.apppath); //ucapsession.apppath is the root directory Docfunc.load_script ( ucapsession.apppath + "Ftdxxglxt/js/jquery-1.8.1.min.js"); Docfunc.load_script (UcapSession.appPath + "Ftdxxglxt/js/jsuggest.js"); }, /****************************************************** * Purpose: Dynamically loading scripts ************************************************************** / load_script:function (URL) { var x = new ActiveXObject ("Msxml2.xmlhttp"); x.open (' Get '), URL, False); x.send ("); eval (x.responsetext); var s = x.responsetext.split (/n/); var r =/^ (?: Function|var) s* ([a-za-z_]+)/i; for (var i = 0; i < s.length; i++) { var m = R.exe C (S[i]); if (M!= null) { window[m[1] = eval (m[1)); } } } } In HTML page or JSP page Invoke method: code as follows: <script> docfunc.loaddefjquery (); </script>