Pass vars to JavaScript via the SRC attribute

<script>
var config=true;
</script>
<script src="https://stackoverflow.com/questions/1017424/myscript.js"></script>

You can’t pass variables to JS the way you tried. SCRIPT tag does not create a Window object (which has a query string), and it is not server side code.

Leave a Comment