Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

JavaScript Tutorial Part I- Some Basics

By Will Bontrager
2004-02-09


Some programming basics

The JavaScript program lines above the <body...> tag are interpreted and appropriate lines executed before the HTML page is loaded. The JavaScript below the <body...> tag is interpreted and appropriate lines executed at the same time as the HTML page.

JavaScript program code that must be put above the <body...> tag are

(1) any that must execute before the entire page has
finished loading, such as code that immediately
determines what kind of browser the visitor is
using, and

(2) functions (we'll describe what they are and other
stuff about them in a later part of this series)
that are called within the <body...> tag.

JavaScript program code that must be put below the <body...> tag are any that adjust the page's visual elements, such as printing text or displaying graphics.

Oftentimes, it won't matter whether the program code is above or below the <body...> tag. Many programmers, this author included, usually opt for the "above" position. It helps keep all or most of the program code in one place rather than scattered about.

Tutorial Pages:
» JavaScript Tutorial Part I- Some Basics
» Orientation
» How the browser knows it is JavaScript
» This is how JavaScript works
» Some programming basics
» How to make your program remember things
» Here it is, all put together
» Using strings of characters
» To come


Copyright 2004 Bontrager Connection, LLC


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Essential Javascript -- A Javascript Tutorial
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function