javascript - Adding Var to jQuery.getScript() url string -


i included var url string js files directory in php page:

var jsdir= "<?php echo get_template_directory_uri(); ?>/js";  

now need add each js files within .js file using jquery.getscript , need adding directory var jsdir url string:

$.getscript( "/plugin.js"); 

this pretty trivial string concatenation

$.getscript( jsdir + "/plugin.js"); 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -