Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Where to put javascript in the HTML page? Header or body?

Reply
Thread Tools

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

 
 
Nasser M. Abbasi
Guest
Posts: n/a
 
      04-03-2010

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-Performan...der_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"


--Nasser



 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      04-03-2010

"Hans-Georg Michna" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Sat, 3 Apr 2010 00:57:31 -0700, Nasser M. Abbasi wrote:
>
>>According to
>>
>>http://www.w3schools.com/js/js_whereto.asp


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.


 
Reply With Quote
 
 
 
 
Garrett Smith
Guest
Posts: n/a
 
      04-03-2010
rf wrote:
> "Hans-Georg Michna" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
>> On Sat, 3 Apr 2010 00:57:31 -0700, Nasser M. Abbasi wrote:
>>
>>> According to
>>>
>>> http://www.w3schools.com/js/js_whereto.asp

>
> 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.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      04-03-2010
Nasser M. Abbasi wrote:
> 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-Performan...der_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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
why does the following with Queue, q.put('\x02', True) not put itin the queue? Gabriel Rossetti Python 3 04-25-2008 03:41 PM
Is there a correct place to put javascript within a html file? mark4asp Javascript 20 10-25-2007 04:50 PM
how to put userid into http header engineur Java 3 09-14-2005 09:00 AM
How to put header onto one file for quick editing Kian Goh ASP .Net 1 06-30-2003 11:47 AM



Advertisments