Re: Passing a variable to an external JS file?
Posted: Thu Dec 16, 2010 4:39 am
Good idea, Weirdan.
The only issue I see is that the script should somehow identify itself (i.e. its own script tag)
One may use the script tag source - not good, file name coupling.
One may use a script tag ID - better.
One may use the first line (e.g.) to identify it by using the innerHTML property.
The only issue I see is that the script should somehow identify itself (i.e. its own script tag)
One may use the script tag source - not good, file name coupling.
One may use a script tag ID - better.
One may use the first line (e.g.) to identify it by using the innerHTML property.
Code: Select all
SCRIPTID = 20