Where to put javascript in the HTML page? Header or body?

  • Thread starter Nasser M. Abbasi
  • Start date
N

Nasser M. Abbasi

R

rf

In addition to what Hans-Georg has so admirally pointed out: Don't believe
many of the things that W3schools says. The site is full of errors.
 
G

Garrett Smith

rf said:
In addition to what Hans-Georg has so admirally pointed out: Don't believe
many of the things that W3schools says. The site is full of errors.

Obvious, glaring errors.

THe FAQ used to contain w3schools links. THere was a long time nagging
request to remove these links. I cannot recall any complaints when that
request was fulfilled.
 
D

David Mark

Nasser said:
According to

http://www.w3schools.com/js/js_whereto.asp

it says:

"Put your functions in the head section, this way they are all in one place,
and they do not interfere with page content."

But according to

"High Performance JavaScript (Paperback) by Nicholas C. Zakas"

http://www.amazon.com/High-Performa...ooks&qid=1270279493&sr=1-37#reader_059680279X

on page 3 it says:

"it's recommended to place all <script>tags as close to the bottom of the
<body> tage as possible"

Both generalizations are wrong. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top