I’m trying to include a .js file like this:
<script src="javascriptfile.js"></script>
But, what I really want, is to pass some parameters to my .js-file like this:
<script src="javascriptfile.js?id=3482"></script>
How should I read the id= part from inside the .js file?
This is only possible by accessing “own” element in the HTML DOM and parse the src attribute.
here’s a nice article with detailed explanations and code samples:
http://feather.elektrum.org/book/src.html