Javascript0

Introduction to JavaScript


Who can read this?
You should have knowledge of HTML before learning JavaScript. A JavaScript program can be typed in head or in body part of the HTML page or it could be attached externally to the web page.

«<JavaScript|Javascript1»>

What minimum Hardware and Software requirements are to run JavaScript?

  • Hardware Requirements

Processor: 486 dx4 or above
RAM: 16 MB
VDU: VGA or SVGA
HDD: 1.2 GB or above

  • Software Requirements

Operating System: Windows or Linux with browser
Text Editor: Any text editor likes notepad or editplus etc.

What is JavaScript?

Html is providing static web pages but with the developments in internet & World Wide Web the interactive communication became a necessity. The World Wide Web is a heap of pages having information if form of text, graphics, pictures, sounds etc. Every page is linked to another page on web and the linked page can have links to other pages.

Browser is a program responsible to understand and interpret the language and perform according to the instructions written in HTML file. Internet Explorer, Netscape Navigator, Fire Fox etc. are such programs.

HTML, JavaScript is integrated
with browser & this integration enables the programmer to add dynamic interaction to the text, picture, information on the web page. JavaScript is case sensitive language i.e.; state is different from State or STATE (these are three different words for JavaScript). JavaScript is capable of sensing the events like mousing clicking, mousing moving etc. JavaScript files are directly executed when user double clicks on them or opens them in Browser.
[Top]

It is not Java

No, JavaScript is not java.
Java is a complex and much more powerful language like C & C++.

While
HTML, JavaScript are integrated with browser & this integration enables the programmer to add dynamic interaction to the text, picture, information on the web page. JavaScript is case sensitive language i.e.; state is different from State or STATE (these are three different words for JavaScript). JavaScript is capable of sensing the events like mousing clicking, mousing moving etc. JavaScript files are directly executed when user double clicks on them or opens them in Browser.

Java is a compiled language, i.e. put into machine language before it gets to your computer. JavaScript is an interpreted language, i.e. put into machine language on your computer. The coding in JavaScript is somewhat similar to Java but it is much less restrictive. For example, JavaScript allows you to assign any type of value to your variables. Java does not. Java is a language that experienced programmers use to develop applications. JavaScript is for us less experienced web developers. JavaScript was originally developed independent of Java by Netscape under the name of LiveScript. Netscape changed the name to JavaScript in 1995 as a result of an agreement with Sun, the developer of Java.

[Top]

Uses

HTML coders are not programmer but using JavaScript an html operator can do programming in a very simple way because JavaScript is very simple and easy to learn and understand. JavaScript is capable of making a static page as dynamic page, where the programmer can put variables. JavaScript has the ability to sense the events like mouse click, movement, keyboarding events etc. We can use HTML in JavaScript i.e. JavaScript can understand HTML. The JavaScript program hence decreasing the unnecessary traffic on lines and useless processing at server end can validate the data fed by the user at client end.
[Top]

Basic coding

A JavaScript program can be kept in html page under <script> JavaScript program </script> tag. We can place unlimited number of scripts in the html program in head or body section.

Keeping JavaScript in head section
If we want that the JavaScript program should be executed when it is called, then we should keep it in head section.

How to keep JavaScript in head section of a HTML file:

<html>
<head>
<script type=”text/JavaScript”>

script code

</script>
</head>

This is just syntax (how & where to type), we will learn it in detail after learning functions.

Keeping JavaScript in body section

If we want that the script should be executed when the page loads then we should keep the JavaScript program in body section.

How to keep JavaScript in body section of a HTML file :

<html>

<head>

</head>

<body>

<script type=”text/JavaScript”>

script code

</script>

</body>
</head>

This is just syntax (how & where to type) we will learn it in detail after learning variables.

  • Putting semi colon at the end of the statement is optional, if you want you can place else you can leave. Putting semi colon at end of the statement depends on the user's choice.

[Top]

It is not Java

It is not Java

It is not Java

It is not Java

«<JavaScript|Javascript1»>

heading

heading level2

heading

heading level 3

heading
heading level 5

color color clor color color color color color color color color color color color color color color color color color

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.