You can assign an id
to the <script>
element and passing the arguments as data-*
attributes. The resulting <script>
tag would look something like this:
<script id="languageId" data-name="en-EN" src="helper.js"></script>
The script could then use the id to programmatically locate itself and parse the arguments. Given the previous <script>
tag, the name could be retrieved like this:
var name = document.getElementById("languageId").getAttribute("data-name");
We get name
= en-EN