Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to javascript

Status
Not open for further replies.

ewan91

Programmer
Jun 25, 2001
13
GB
hi

i'm just learning JavaScript and have a couple of questions if anyone could help

1. is there any rules as to when you should include javascript in between <HEAD></HEAD> and when in between the <BODY></BODY> tags

2.i've written an applet and when trying to get it to work the page runs but the CirApplet class cannot be found, they are both in the same file, here is the code below

<APPLET CODE=&quot;CirApplet.class&quot; NAME=CirApplet WIDTH=300 HEIGHT=400></APPLET>

thanks

ewan
 
you can put ypur javascript anywhere on the page providing you enclose your codein <script type=&quot;text/javascript&quot;></script> tags or you can put them on an external script sheet using the src attribute of the script tag like this...

<script type=&quot;text/javascript&quot; src=&quot;myscript.js&quot;></script>

upto you!!

i dont much about applets but dont you need a 'codebase' attribute? sorry i cant be any more help..

 
It's traditional to include javascript code in the head section because that gets loaded first, so if you need to call any of your code from the body section you know it's already loaded. You HAVE to include it in the body if it needs to do something there specifically, for example if you use document.write() to create part of the html. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top