RE: Where to put <SCRIPT>

by "Christian Lavoie" <clavoie(at)enter-net.com>

 Date:  Tue, 25 Aug 1998 14:52:01 -0400
 To:  <hwg-theory(at)hwg.org>
 In-Reply-To:  gmx
  todo: View Thread, Original
> But what is that?
>
> > src="foo.js" attribute.

<script src="foo.js"></script> (end tag still required)

>
> Am I right assuming that you can put your js definitions in an
> extra file? And,

Yes, you are right.

> for example if all your pages use the same, heavy js code, they
> can all use the
> same file and therefore save download time? Could you please

Yes again.

> elaborate on that?

The file contains exactly what the tags would be containing, so no extra
tags, just plain function declarations and JS code.

I have never experimented with using both a src attribute and actual code
between the SCRIPT tags, as in the following example:

<script src="joo.js" language="Javascript">
function HelloWorld
{
	alert('Hello, World!');
}
</script>

but I guess it should be working.

Hmmm... What else needs to be said?

-----
Christian Lavoie
clavoie(at)enter-net.com
UIN: 947212

HWG hwg-theory mailing list archives, maintained by Webmasters @ IWA