#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    3
    Rep Power
    0

    javascript etiquette


    What's standard Javascript ettiquet when it comes to using it between the body tags or the head tags?

    Is it purely personal preference? Just convenience? Does it even matter whether your code is meant to be in the body or the head?

    /Steve
  2. #2
  3. PHP Princess
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    CA, USA
    Posts
    18
    Rep Power
    0
    I believe most javascript should be defined within the <head> tags or linked externally between the tags. The only time I would use javascript in the <body> tags is when I use functions like document.write()
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canberra, Australia
    Posts
    348
    Rep Power
    14
    pretty much personaly preference I think. I prefer it all in the head, just so I know where to look for it.

    agree with PHPprincess, only in body with document.write stuff.

IMN logo majestic logo threadwatch logo seochat tools logo