I have a series of javascript functions stored in a javascript file called scripting.js.
Some of the functions refer to values declared as global variables in the main file whose values may change in time, I will be handing this integration over at some time and do not wish the person responsible for the system to have to access the scripting.js file as it will cause a risk of change. I therefore want to list my global variables in an external file that scripting.js can refer.
The main question is [how] can I link to an external js file from within scripting.js and if so how?
Javascript include
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Javascript include
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
-
- Administrator
- Posts: 78399
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Re: Javascript include
Thanks for the speedy reply, maybe I should have stipulated that I need it called from within the js file itself and not from a HTML page
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
-
- Administrator
- Posts: 78399
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Javascript include
As far as I know, JavaScript itself doesn't have an include feature. Every "solution" I've seen depends on adding a script tag to the HTML page the JavaScript is run from, either manually or programmatically.
Best wishes,
Hans
Hans