HTML Haven
  -- Basics
  -- Head/Body
  -- Font
  -- Links
  -- Images
  -- Tables
  -- Forms
  -- Attributes
  -- Wizards



CGI Haven
  -- Basics
  -- Variables
  -- Adding HTML
  -- Sending EMail
  -- Flat-File Databases
  -- Validation
  -- Regular Expressions
  -- Custom Script



JavaScript Haven
  -- Basics
  -- Variables
  -- Arrays
  -- Validation
  -- Functions
  -- Loops
  -- Conditionals
  -- Windows
  -- Events
  -- Forms
  -- Extras



JavaScript - Variables tutorial by Matt
Creating variables in JavaScript is very easy but there
if a common mistake that a lot of programmers make when setting
variables. JavaScript has adapted to this but sometimes the
JavaScript Interpreter decides to complain about it.

name = "Jeff"; var name = "Jeff";
Both of these may look like valid JavaScript statements
but the first one is the common mistake that people make. You should always
right your variables as the second on using the var reserved word
There are different types of variables, both are set basically the same way.

Setting a numeric variable: var num = 45; Setting a string variable: var num = "forty five"; As you can see there is only on different and that difference is
that with a string variable you must put the string inside double quotes.
Now lets try setting the value of a variable with the contents of another variable.

Numeric Varaibles: var num1 = 45; var num2 = num1; String Variables: var num1 = "forty five"; var num2 = num1; As you can see they are both set the same way and it is really easy to
transfer the contents of one variable to another.

Now lets try a nice example.

<html> <head> <title>Using Variables</title> </head> <body> <script language="JavaScript"> var first = prompt("Enter Your First Name"); alert(first); </script> </body> </html> This is script is a very simple example of using variables. The JavaScript
takes place in the body section of the page so it is executed without being
called by a button or something.You then set a variable named "first" and
you set the value of it. The value of this variable will display a dialog
box that you will learn about in a later section. This will ask the user
to enter their first name then when they click ok an alert box pops up with
the name then entered inside of it.

Thats it for this lesson move on the next section...Arrays




Scripting Network
  -- Register
  -- Login
  -- Contact
  -- Web Board
  -- Home



Fredward Inc.
  -- Websites
  -- Programs
  -- Graphics
  -- Order
  -- .::Other::.
  -- Contact
  -- Pricing
  -- Help/FAQ
 >>Official Site