On 18 Jul 98, Ferd Lazarus wrote:

>  Yes I know it works. Browsers are rather robust.
>  I was under the impression however that JavaScripts, 
>  for code meeting the standards, were to placed either: 
> 
>  1. within the <HEAD></HEAD> constructs for delayed 
>  action or
>  2. within the <BODY></BODY> for inline action.

Well, pretty much.  <script> can properly be within either the body or 
head, yes, though I would quibble very slightly with the term "delayed 
action".  

<script> does have an attribute 'defer', which would delay the execution 
of the code until the page was fully loaded, if either MS or NS happened 
to support that attribute.  At this time I don't believe either of them does.
(However, you can achieve a similar effect through the use of JS itself, 
depending on your application.)

In any case, scripts that "generate body content" are best located within 
the body, and any others in the head.  So say the HTML 4.0 specs at any 
rate.  Although I think the point is largely moot, as neither IE nor MS seem 
to much care either way.

As for a script entirely outside <html>, well, that's verboten certainly.  A 
fully legal document starts with the DTD and ends with </html>, no 
exceptions.  But again, the main browsers are, as you say, robust :)

-----------
Brent Eades, Almonte, Ontario
   E-mail: [EMAIL PROTECTED]
           [EMAIL PROTECTED]
   Town of Almonte site: http://www.almonte.com/
   Business site: http://www.federalweb.com

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to