I want to pass a parameter to some javascript using a single line of code, like this:
<script language="JavaScript" src="courselist.js?subj=MATH" type="text/javascript" />
Inside the javascript file, how can I get the value of the parameter “subj”?
Thanks
That’s as far only possible by accessing “own”
<script>element in the HTML DOM and parse thesrcattribute.Long story short, here’s a nice article with detailed explanations and code samples: http://feather.elektrum.org/book/src.html