An Introduction to JavaScript

What is JavaScript?

So, what do you think is JavaScript? Put in simply, JavaScript is a cross-platform, light-weight and interpreted language used for scripting. Initially, JavaScript was created to, “bring life to web pages”. The programs in this language are referred to as scripts. Scripts can be written right into the HTML of a web page and can run automatically with the loading of the page. So basically, JavaScript is well-known for the development of web pages, and is used by many non-browser environments, too.

History of JavaScript

JavaScript History

JavaScript was originally created by Brendan Eich in 1995, which made an appearance in Netscape, which was a popular browser of that time. Initially, the language was called LiveScript, but was later renamed as JavaScript. Many programmers think that JavaScript and Java are the same. But, in reality, JavaScript and Java are very much related, except for the word Java. Talking about it, JavaScript is a scripting language, whereas Java is a complex programming language. The syntax of JavaScript is influenced by the programming language C, mostly. Presently, JavaScript can execute not only in the browser, but also on the server, or on any device having the special program known as the JavaScript engine.

Why is it called JavaScript?

Having the name of LiveScript initially, the name Java was marked later, as it was quite popular at that time. And thus, it was decided that positioning a new language as a “younger brother” of Java would be of help. But, with evolution, JavaScript became a totally independent language having it’s own specification known as ECMAScript, having no relation to Java at all.

How to run JavaScript?

JavaScript being a scripting language, it cannot run on it’s own. Actually, it is the browser that is responsible to run JavaScript code. With the request of a user for an HTML page with JavaScript in it, the script is forwarded to the browser, and it is up to the browser to have it executed. The important edge of JavaScript is that, it is supported by all modern web browsers, be it Internet Explorer, Firefox, Google Chrome, or any other browser for that matter. Also, JavaScript runs on any of the operating systems, including Linux, Mac or Windows, which overcomes the disadvantages over other scripting languages.

What can in-browser JavaScript do?

The modern JavaScript is a secured programming language. The capabilities of JavaScript depend a lot upon the environment that it is functioning in. For example, Node.js supports functions that enable JavaScript to perform network requests, write/reason arbitrary files, etc. Now, in-browser JavaScript is able to perform a lot of functions, including functions in relation to interaction with the user, the webserver, webpage manipulation, etc. Some of them are given below:

  • Get and set cookies, show messages, ask questions to the visitor.
  • React to user actions, run on key presses, mouse clicks, pointer movements.
  • Add new HTML to the page, modify styles, change the existing content.
  • Remember the data on the local storage.
  • Send requests over the network to remote servers, upload and download files, etc.

What is so great about JavaScript?

  • With JavaScript, simple things are done simply.
  • It is supported by all major browsers and is enabled by default.
  • It is fully integrated with HTML/CSS.

Summary

Presently, JavaScript holds a unique position as the most widely-used browser language, having full integration with HTML/CSS. Created as just a browser language, it is used today in many other environments as well. With all the features of JavaScript, and the functions performed by it, we at Arraign, can assure you that it will be utilised with the aim of optimizing your convenience and priorities.