Click to See Complete Forum and Search --> : Rookie Q: Run Multiple Scripts?


Vernoman
07-22-2003, 05:14 PM
Can you place multiple JavaScript Scripts in a single web page?

pyro
07-22-2003, 05:21 PM
Yep.

Charles
07-22-2003, 05:21 PM
No, but you can have one script that does lots of different things. And that one script can be cobbled together from other scripts as long as there are no conflicts.

pyro
07-22-2003, 05:22 PM
Huh? :confused:

Charles
07-22-2003, 05:25 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<script type="text/javascript">
<!--
pie = Math.PI;
// -->
</script>

<script type="text/javascript">
<!--
alert (pie)
// -->
</script>

How many scripts is that?

pyro
07-22-2003, 05:29 PM
Ok, I guess we took the question to mean two different things. I assumed that they would be asking one of these two things:

1: Can you have multipe <script type="text/javascript"> tags
or
2: Can you combine two different scripts (ie, two scripts they downloaded, etc...)

Charles
07-22-2003, 05:31 PM
As did I, and my answer indicated a yes to both of them with the caution that the scripts will be joined into one and that they might, therefore, conflict.

Vernoman
07-23-2003, 01:28 AM
Wow, I didn't know I'd start such a fuss! LOL

Thanks for your help. I think I've got it figured out.