I've noticed that some scripts are contained in an external file while most are in the HEAD tag. But then you get some scripts that are placed in the BODY.
Is there any basic rule that would help me and my fellow newbies on where to put a script?
I've noticed that some scripts are contained in an external file while most are in the HEAD tag. But then you get some scripts that are placed in the BODY.
Is there any basic rule that would help me and my fellow newbies on where to put a script?
Most of the time, you can put things on the <head> tag. Follow your script's instructions just to be sure.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
There are 4 places to put scripts:
1. In an external file-- this will then have to be grabbed by the page with code in one of the following sections.
2. In the head section-- most everything goes here.
3. In the body, where it should work-- if you want to put this, for example, next to a link and have it relate to that link, that can work. this isn't as common but happens sometimes, and can usually be associated with more code in the head section.
4. After the body, before the end of the html-- I don't know if this is even valid, but I know that some script suggest this-- but it's rare.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks