JavaScript Introduction

free php tutorials, php classes, php utilities, free tools
  • JavaScript was designed by Netscape Corporation.
  • JavaScript is used to perform calculations, check forms, write I nteractive games, add special effects, customize graphics selections, create security passwords and more
  • JavaScript is a lightweight interpreted programming language with elementary object-oriented capabilities
  • Javascript can easily create interactive webpages
  • JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
  • Some people says that JavaScript is Java because of similar name, it is not true, JavaScript is product of Netscape, but Java is product of Sun Microsystems.
  • A JavaScript is usually embedded directly into HTML pages
  • JavaScript syntax is simplifier with C++ and Java.
Syntax
  • JavaScripts in the body section will be executed WHILE the page loads.
  • JavaScripts in the head section will be executed when CALLED.

How to Put a JavaScript in an HTML Page


<html>
<body>
<script Language="JavaScript">
document.write("Hello Programmers!")
</script>
</body>
</html>

And it display following output:

Hello Programmers!

<script> is an HTML tag that has an attribute JavaScript

<script Language="JavaScript">

document.write is standard javascript command used to display output on HTML page.

document.write("Hello Programmers!")

The script ends.

</script>

Ending Statements of JavaScript
The ending statement of JavaScript is semicolon (;).

Bookmark This Page