I have a page name index.php. And I have a script variable as follows at the top of the page:
<script>
var search_quarry = "some_test";
</script>
At the bottom of the same page I want to add this variable into the src attribute of a script tag:
<script src=NEED_TO_ADD_HERE></script>
This doesn’t work:
<script src=search_quarry> </script>
Can anyone please tell me how to do this?
You’d need to do with DOM manipulation:
or, as an alternative, though I’m not sure if this’d work: