Click to See Complete Forum and Search --> : Scripts inside of a script


Burrow
02-02-2003, 07:50 PM
I'm fairly new to the whole Javascript Scene, and was wondering if it is possible to have a script inside of a script?

Such as:


<!--

Some Variables
Some Formulas
Etc...

<Script Language="Javascript">
<!--

Some more Variables
Some more Formulas

-->
</script>

-->

Then take this script and place it onto a page using the

<Script src="NAME HERE"></script>

I was just wondering if that was even possible, I've tried it before and it did not work very well.

Any help is appreciated.
Thanks.

Da Warriah
02-02-2003, 08:12 PM
theres no reason to divide your scripts up, its more sensible to just plop them all together...it will still work fine, and you can still call the scripts from elsewhere using functions...

Burrow
02-02-2003, 08:50 PM
Oh,

okay. That does make sense.

Thanks a bunch.

Burrow
02-02-2003, 10:26 PM
Okay,

New question. Is there anyway that I can take a number by using the prompt command.

such as:

var number= prompt("put in a number","");

Then take that and find a way to divide it by three and add in comma's?

Or would I have to just go and put in a second prompt command?

Any help is appreciated.
Thanks