Amazon.com: PC Books || Educational Software || Magazines
Amazon: Books-CA || Software-CA || Books-UK || Software-UK

HTML | Javascript | ASP | PHP | VBScript | SQL | Hardware | PC FAQ| WinXP|

Learn to Build, Upgrade, or Repair your Computer Ebook + PC Safety 101 kwwebservice.com Reasonably priced web development & hosting
JavaScript
Introduction
Variables & Arrays
Functions
If Statements
Case Statements
Loop Statements
Operators
Form Validation
Alert
Date Objects
Window Objects
Javascript Books
Books @ CA Amz
Books @ UK Amz
Books @ US Amz

  :: Home
PC Topics
  :: Build A PC
  :: Windows XP
  :: PC Help
Tutorials
  :: HTML
  :: JavaScript
  :: ASP
  :: PHP
  :: VBScript
  :: SQL
Miscellaneous
  :: Code/Scripts
  :: Forum
  :: Links
  :: Contact us
  :: Tell A Friend
  :: In Somali
  ::
Web Articles
  Top Web Hosting
Reviews
  Processing
Online Card Payment Guide
  Domain name
registration & buying guide
  Getting
a website online guide
  Search Engine
submission & optimization tips
Netfirms Web Hosting
Free trial
Quality business correspondence.
Yahoo! Search Marketing

Basic Javascript tutorial for beginners

JavaScript?

Javascript is language developed strictly for the web sites to create interactive web page that can handle calculations, controls such as displaying certain information when certain values provided, validate forms, and more without whole lot of programming effort.  In short description, javascript is easy programming language specifically designed to make a web page elements interactive. An interactive element is one that responds to a user's input.  It's developed by NetScape and is not connected to Java but has similarity with C and C++.  JavaScript is case sensitive.

Like the HTML javascript uses open and close tags. Use the following syntax to start and end any javascript code.
<script language="javascript">
  put your java script statement here
</script>

<script> - Indicates the document is script language.
<language> - Defines the script language, (eg: javascript, vbscript, etc). In this case, language is defined as javascript.
</script> - Closes the script tag.
// - This is a comment line for javascript, which means the computer will not interpret this line as a code.

The following is simple java script program displaying a dialog box with the text This is javascript dominated page and writes same text on the browser.
<html>
<head>
</head>
<body>
<script language="javascript">
   alert("This is a javascript dominated page");
   document.write("This is a javascript dominated page");
</script>
<body>
<html>

How it works
We started this code with the start and close tags:
Start <script language="javascript">
Close</script>
Then we display a dialog box with this statement:
alert("This is a javascript dominated page")
Alert is a javascript method that displays provided string value within brackets.
Then we write same message on the browser using this statement:
document.write("This is the javascript dominated page")
Document is an object means this page. Write is a method that instructs the browser to write the provided string value.

Javascript code can be placed in the head or body section of the html document. The head section is best suited for all your functions and the body section is best for immediate execution code like the one above.

Home Variables & Arrays
Bluehost.com Web Hosting $6.95
PC System Tools
SpyCleaner
Registry Mechanic
4Diskclean Pro
Health PC Club
TweakNow
Registry Washer
SpyAnyWhere
System Lifeguard
...More/Details

PC Articles
  Computer Safety
prevent viruses & Spyware