The programs in this language are called scripts. They can be written right in the HTML and execute automatically as the page loads.
Scripts are provided and executed as a plain text. They don’t need a special preparation or a compilation to run.
Different engines have different “codenames”, for example:
- V8 – in Chrome and Opera.
- SpiderMonkey – in Firefox.
- …There are other codenames like “Trident”, “Chakra” for different versions of IE, “ChakraCore” for Microsoft Edge, “Nitro” and “SquirrelFish” for Safari etc.
- Add new HTML to the page, change the existing content, modify styles.
- React to user actions, run on mouse clicks, pointer movements, key presses.
- Send requests over the network to remote servers, download and upload files (so-called AJAX and COMETtechnologies).
- Get and set cookies, ask questions to the visitor, show messages.
- Remember the data on the client-side (“local storage”).
The examples of such restrictions are:
Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like “dropping” a file into a browser window or selecting it via an
The limitation is again for user’s safety. A page from
http://anysite.comwhich a user has opened must not be able to access another browser tab with the URL
http://gmail.comand steal information from there.
- Full integration with HTML/CSS.
- Simple things done simply.
- Supported by all major browsers and enabled by default.
While planning to learn a new technology, it’s beneficial to check its perspectives. So let’s move on to the modern trends that include new languages and browser abilities.
That’s to be expected, because projects and requirements are different for everyone.
Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and autoconverting it “under the hood”.
Examples of such languages:
- TypeScript is concentrated on adding “strict data typing”, to simplify development and support of complex systems. It is developed by Microsoft.