Loading Javascript Dynamically and how to check if the script exists

后端 未结 9 569

I am using the following technique to load up Javascript dynamically:

var script = document.createElement(\"script\");
script.type = \"text/javascript\";
scr         


        
9条回答
  •  生来不讨喜
    2020-12-01 17:02

    One way would be to define a variable in the script you include and then check whether this variable is defined, or not.

提交回复
热议问题