[Javascript] How to call scripts that are all in one file...?

Jonathan Gold johnnyclock at gmail.com
Fri Feb 3 20:15:31 CST 2006


I guess I wasn't clear; sorry. They are presently each in their own
file in a folder called 'javascripts' and I call them, now, like this:

<script type="text/javascript" src="javascripts/myRoutine1.js"></script>

And, then further down the html file, I call another:

<script type="text/javascript" src="javascripts/myRoutine2.js"></script>

And then, still further:

<script type="text/javascript" src="javascripts/myFunction1.js"></script>

What I would like to do is have them all be in _one_ file inside the
'javascripts' folder; say a file called 'myScripts.js'. When I try to
do this now, I do not know how to separate the different functions and
routines in that myScripts.js file. When I call the whole file by
name,

<script type="text/javascript" src="javascripts/myScripts.js"></script>,

all the scripts run. How do I call them one at a time?

My intuitve approach was to call a single one like this:

<script type="text/javascript"
src="javascripts/myScripts.js/myFunction1()"></script>

but that didn't cut it.

Thanks.

On 2/3/06, Troy III Ajnej <trojani2000 at hotmail.com> wrote:
> Supposedly that you are not throwing a joke on us, I believe you should call
> them, -individual functions, by their names. As you would call, John, Paul,
> George, Ringo individualy from the group/band. Obviously you can not call
> the Beatles in order to get a real response since there is no such call
> implemented and functional even in real life. But you can introduce them to
> the HTML show as Beatles.js and then you can call them by names as the event
> takes place: onLightsOff="Ringo(drums)", etc.
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Troy III
> progressive art enterprise
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>

--
Jonathan
Berkeley, CA
http://home.pacbell.net/jonnygee/


More information about the Javascript mailing list