logo
Aug
22
nik

XHTML-Compliant Technique for Passing Parameters to Javascript Script Files

Joe Brinkman posted a technique to pass parameters to Javascript script files. The approach is simple — append a standard querystring to the script URL and obtain the parameters by locating the script element using the ID attribute, and parsing the key-value pairs from the “src” attribute. A sample usage is like this: <script id="MyScript"...
logo