so i am declaring a variable inside of a .php file
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/script/jscript_pages.js">
var templatePath = "<?php bloginfo('template_directory'); ?>";
</script>
But i want to use the variable templatePath inside of jscript_pages.js but when i do it like this my console says: Uncaught ReferenceError…
I hope someone can help 🙂
Thanks
The content of a script element is alternative content to use if the browser doesn’t support
src, it isn’t a script to run before running the external script.Use two script elements.