PDA

View Full Version : Can you please give me an example on how to put multiple javascript?


nikolasriki
09-24-2002, 09:49 PM
There's an answer already on how to put multiple javascript but I can't understand it. I am trying lots of times already using the instructions.
Please give me an example like you are putting it in your script, . And how can I make it in the different places, I mean I put the script by going to insert then HtML/ Script and that's where I put it so can I put a new box or just one box? so it will go to different places in one page?. I am using geocities making my website!

ez4ne12c
09-24-2002, 10:11 PM
You can put multiple javascripts in a html document using
<script>
</script>

tags, these can appear in the head or body of the document.

Here is an example

<HTML>
<HEAD>
<script>
document.write("this part was written by the head script.<br>")
</script>
</HEAD>
<BODY>
<script>
document.write("this part was written by the first script in the body<BR>")
</script>
<b>This is some other stuff in the body that is just plain html in bold</b><BR>
<script>
document.write("<H1>this part was written by the second script in the body, it is big</H1>")
</script>

</BODY>
</HTML>


Some suggest to hide the script tags from old style browsers, you can do this by putting them in particular comment tags
<!--Start hide
<script>
document.write("This script will be hidden from older browsers");
</script>
//End hide-->