I would like to retrieve the contents of different external JS files with a textbox or drop-down selection.
Is this possible?
[code]
<select id=”SBox” onChange=”LoadJSinfo(this.value)”>
<option value=””>Choose Month</option>
<option value=”Jan.js”>Jan</option>
// …
<option value=”Dec.js”>Dec<option>
</select>
Where ‘Jan.js’ … ‘Dec.js’ would be stand alone external files.
I am stuck on how to create the function ‘LoadJSinfo(filename)’.
My initial thoughts were:
[code]
function LoadJSinfo(filename) {
<script type=”text/javascript” src=filename></script>
}
But obviously, that doesn’t work.
Is there a way to load the external file contents after the page has been displayed?