JavaScript Tutorial Part I- Some Basics
By Will Bontrager2004-02-09
Here it is, all put together
<script language="JavaScript">
<!--
var blahblah = 5;
document.write(blahblah);
// -->
</script>
Put the above JavaScript code somewhere below the <body...> tag of a web page and you'll see how it prints the value of "blahblah". (You put it below the <body...> tag because it actually writes something to the page -- and some browsers protest if you try to write something to the page above the <body...> tag.)
The above demonstrates a simple use of a variable. Other uses (described in a later part of this series) include doing mathematical calculations, manipulating strings of characters, storing form field contents, and having your program make decisions based on what a variable contains.
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
