[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
BeginnersGuideToJavaScript

Beginners Guide To JavaScript

What Is JavaScript?

JavaScript was originally created by  ?Netscape communications in 1995. It was created so that non-Java programmer's could recreate some of the same capabilities of a Java enabled web page. It was first titled "LiveScript" by the head of the project, Brendan Eich, but was renamed JavaScript shortly before the release of Netscape Navigator 2.0. JavaScript is a small computer programming language used in the creation of dynamic web pages. It is basically like running a small program in the webpage. JavaScript is support by both Netscape Navigator/Communicator and Internet Explorer as well as most other current web browsers.

What Can JavaScript Be Used For?

The most common use for JavaScript is form validation or manipulation. It offer's web designers a way to validate a form's correctness before the page is submitted. JavaScript can perform a multitude of tasks such as opening new windows, generating text, identifying the user's web browser, and manipulating styles. JavaScript is found on most advanced web sites due to it's extreme usefulness for providing interactive web pages.

What Is The Syntax Like?

JavaScript resembles Java or C in syntax. It is less strict than C, but more strict than Perl. You'll find familiar things such as functions, arguments, variables, loops, and if statements. JavaScript is not completely strict on it's variables. It requires you to declare the name as a variable, but does not specify a data type.

An Example JavaScript Script

This is an example of a JavaScript enabled web page.

<html>
<head>
<title>JavaScript Test</title>
</head>
<body onLoad="LoadMe()">
<script language="JavaScript">
<!--
function LoadMe() {
    var text = "Hello, World!<br>";
    for (var i = 0; i < 10; i++) {
      document.write(text);
    }
    document.write("Ten lines of \"Hello, World!\"");
  }
//-->
</script> 
</body>
</html> 


What Do I Need To Get Started?

JavaScript requires only two things to get started. One, a JavaScript enabled web browser such as Internet Explorer or Netscape Communicator. Second, a simple ASCII text program such as Notepad (standard on all Windows machines), or vi, eMacs, Kate, etc. for a UNIX/Linux machine.

Common JavaScript Problems

Case is a big issue. JavaScript is case-sensitive, meaning that if you name a variable MyVar, you cannot call it as myvar or mYvAr. Forgetting to close your curly braces or put a semicolons at the end of a line of code are also common mistakes. It helps to indent lines inside curly braces so that the braces are aligned.

Are There Any JavaScript Tools I Can Buy?

You can find a variety of tools for download in the JavaScript Tools section.

What Does Programmers Heaven Offer Me?

Visit the JavaScript section of the site to see articles on JavaScript as well as source code, developer tools and links to many sites, including tutorials pitched at many different levels. If you need assistance, why not post your question on our friendly and lively JavaScript message board.

Further Reading

Amazon.com offers quite a few books on JavaScript for you to read. A few that may interest you are:

There are also quite a few tutorials available on the internet. Here are a few of them: Quick Reference:

last edited (March 18, 2003) by ppn, Number of views: 30196, Current Rev: 7 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.