Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 2.63 KB

Introduction.md

File metadata and controls

40 lines (27 loc) · 2.63 KB

JavaScript Tutorial

This repository basically for those who are eager to learn JavaScript.

An Introduction to JavaScript

Let’s see what’s so special about JavaScript, what we can achieve with it, and which other technologies play well with it.

What is JavaScript?

An programming language which is build for make page more alive. They can be written right in a web page’s HTML and run automatically as the page loads in browser.

Javascripts are provided and executed as plain text. They don’t need special preparation or compilation to run.

Why is it called JavaScript?

When JavaScript was created, it initially had another name: “LiveScript”. But Java was very popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help. But as it evolved, JavaScript became a fully independent language with its own specification called ECMAScript, and now it has no relation to Java at all.

Javascript Do and Don't

1. Javascript allow to do following things

  1. Add new HTML to the page, change the existing content, modify styles.
  2. React to user actions, run on mouse clicks, pointer movements, key presses.
  3. Send requests over the network to remote servers, download and upload files (so-called AJAX and COMET technologies).
  4. Get and set cookies, ask questions to the visitor, show messages.
  5. Remember the data on the client-side (“local storage”).

2. Javascript not allow to do following things

  1. JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.

  2. JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that’s a safety limitation.

  3. Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port). This is called the “Same Origin Policy”. To work around that, both pages must agree for data exchange and contain a special JavaScript code that handles it. We’ll cover that in the tutorial.

why we should learn javascript

In my opinion these are the some compelling reasons to learn JavaScript.

  1. Full integration with HTML/CSS.
  2. Simple things are done simply.
  3. Support by all major browsers and enabled by default.