JavaScript – Introduction, History, and Syntax

javascript

What is “JavaScript”?

  • The first appearance of JavaScript was made in Netscape 2.0 in 1995 with a name Live Script.
  • JavaScript is a client-side scripting language with the object-oriented capabilities that allows us to build interactive web pages.
  • It is open and cross-platform.
  • For our simple understanding, we can say that JavaScript code is executed whenever the user submits the form and that form is submitted to the webserver only if the entries got validated.

Advantages of JS:

  • It is less server interaction.
  • Provides the immediate feedback to the users.
  • Increased interactivity.
  • Richer Interfaces.

Limitations of JS:

  • We can find some of the drawbacks too apart from JS advantages. Some of the major limitations are:
  • Doesn’t allow the reading or writing of the files.
  • Cannot be used for the Networking applications.
  • Doesn’t have any multithreading or multiprocessing capabilities.

History

1995   – Developed as LiveScript 1996   – Developed as JavaScript NetScape 2 / IE 3 JScript 1997   – ECMAScript 1999   – ECMAScript 3 2009   – ECMAScript 5

Now let’s move ahead of JavaScript.

A Java Script consists of JS codes placed within the <script> …… </script> HTML tags. Usually the <script> tags are placed inside the <head> section.

The script tag has two most important attributes:

  1. Language: This attribute generally specifies that what scripting language we are using. Usually, the value will be JavaScript.
  2. Type: This attribute is what is now recommended to indicate the scripting language in use and its value should be set to “text/JavaScript”.

Javascript Syntax eg.

<script type='text/javascript'>
JavaScript Code
</script>

Or Simply you can write inside <script> </script> 

<script>
JavaScript Code
</script>

Or

<script language='javascript'>
JavaScript Code
</script>

Next: Learn How to Print Hello World on JavaScript