Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is There Any Guide to Determine Where Script Tags Be Used

Status
Not open for further replies.

karu76

Programmer
Dec 14, 2000
27
0
0
SG
Hi,

just a simple doubt...i have noticed that some scriptwriters write the scripts in the <head> tag and others in the <body> tag and some in both..

Is there any reasons or implications on where the script tag is used...

Hope someone can clear help in this...

thanks
 
most sources recommend putting scripts in the head to separate from html code, but technically you should be able to put them anywhere on the page (even outside <html></html> tags). you'll need to put scripts in the body to write out content on run-time and things of that nature. also, some like to put scripts after </body> so that the html content can load first (though i'm not sure whether any rendering speed improvements are perceived or real).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top