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

Troy III Ajnej trojani2000 at hotmail.com
Sat Feb 4 21:31:38 CST 2006


This is really confusing, your routine is good except for this:
><script type="text/javascript"
>src="javascripts/myScripts.js/myFunction1()"></script>
dit it actually run? Amazing!

If your separate script files are wraped up in a function names{...the 
script instructions...} like this, they should not execute on load time, 
they should not execute at all, if not called by the script itself. But, if 
your script instructions are plain, they will execute while read 
preogressively.
Make sure the scripts are separated by their function nature, after naming 
them and loading them (functions) fromt the script with your routine:
><script type="text/javascript" src="javascripts/myScripts.js"></script>,
You have to either create another script from which you call the functions 
individually, or call them directly from the the page in conjunction with 
some event. But it all depends on what does each script do.
Your 3 script files run separately with some delay between each other 
because of a download  delay, not because they are called in separate blocks 
of script tags.
In order to give you a real answer, you have to explain what each script 
does and on what condition you like them to act and of course do they all 
have their unique function names (!not the script file names)?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Troy III
progressive art enterprise
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


>From: Jonathan Gold <johnnyclock at gmail.com>
>Reply-To: "\[JavaScript List\]" <javascript at LaTech.edu>
>To: "[JavaScript List]" <javascript at latech.edu>
>Subject: Re: [Javascript] How to call scripts that are all in one file...?
>Date: Fri, 3 Feb 2006 18:15:31 -0800
>
>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/


>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Javascript mailing list