The modern Internet is hard to imagine without interactive web pages. Invisible updating, receiving messages, sending them - all this became commonplace thanks in large part to special scripting languages. This article will talk about what JavaScript is.
Description
JavaScript refers to languages ββthat have no particular paradigm differences. This means that you can write in object-oriented, functional, imperative and other styles. It was this approach that greatly affected the simplicity of its study and application. By the way, just for this purpose it was created.
Most likely, the fact of simplicity and functionality played a decisive role in the development and dissemination of the language. It has become so popular that it is used in almost all areas of web programming. JavaScript does not belong to any company. However, the name JavaScript is registered for Oracle, which also owns Java.
A bit of history
The first attempts to create a new convenient language were made in 1992 by Nombas. The language was taken as the basis. The final version was named CEnvi. However, this product has not received much distribution. Then the programmer Brendan Eich, Netscape co-founder Mark Andrissen and Sun co-founder Bill Joy, got down to business. They cherished the dream of creating a language that could integrate all parts of the web interface, and at the same time be easy to learn and use. The syntax was taken from high-level languages ββthat were fashionable at that time - SI and Java.
In the course of development, the product was renamed several times. The initial version was called Mocha, then - LiveScript, and already in the final - JavaScript. Nowadays, almost every Internet user even remotely knows what JavaScript is.
Language features
What can be done in JavaScript is practically unlimited. It is embedded in applications, web pages, services and standalone products. The new-fashioned and powerful AJAX bundle brings even more possibilities to realize the potential of JavaScript. It is it that makes it possible for the user to quietly update a small part of the page without reloading it entirely. This allows you to save traffic and increase the usability of web interfaces.
Application inside web pages
Embedding in the document occurs by specifying special tags that mean the beginning and end of the script - <script> and </script>. As a rule, embedding a script directly in HTML-code is considered bad manners. A more elegant and recognized way is to put the code in a separate file, and then connect it to the right place on the page.
What is JavaScript in terms of syntax? A typical code might look like this:
<script>
alert (`Hello World!`);
</script>
This is the simplest implementation with which you can see the basic elements and their use. Variables are declared in the language by specifying the var keyword and the subsequent name. For example, like this: var variablename.
To assign it a certain value, an equal sign is used. There are 6 known types of variables in JavaScript. This number, string, boolean, zero, undefined, and object. Typically, a hard type declaration is not required during creation. That is, a variable can take on almost any value. You can learn more about the properties of the language from the official manuals for it.
Java connection
It is believed that the JavaScript scripting language is associated with Java. This is not entirely true. They are similar in several aspects - both are object-oriented and have C-like syntax. Also, languages ββare actively used to create web applications and services.
However, the differences are more significant. The implementation of the object-oriented paradigm occurs in Java using classes, and in JavaScript - prototypes. They also differ in typification. Java compiles into its own special bytecode. JavaScript is interpreted directly from the script.
Known Issues
Security Concerns in JavaScript - Using a so-called XSS attack. It is based on the implementation of the script in the body of the page that is displayed to the user. The code can obtain the rights of the current visitor and use them to the detriment of, for example, steal personal data.
What are cookies and javascript? A cookie is a small piece of data that is sent by a web application to a user's computer. It is used to identify visitors, record their preferences, or simply to store site settings. This can also be used by attackers using JavaScript. After gaining access to cookies, a hacker can log in to the site under a user profile and steal personal data. A client application written in JavaScript may undergo reverse engineering and may not authenticate properly. Therefore, JavaScript does not provide a means to provide a decent level of security.
Issues of vulnerability and errors that may occur may not be caused by JavaScript. Many browsers contain potential βholesβ in their code. And JavaScript is very often used only as a tool for their use.
Often on the Web you can meet a question from users of social networks: what is a Vkontakte JavaScript error? This is a fairly common problem. Its root may be hidden in old software, cache, or in the presence of viruses on the computer. For treatment, you need to try to clear the cache, update Java and Flash on the PC. Also, very often people are interested in what JavaScript void 0 is. In simple terms, the web developer, for some reason, decided to keep the link active and active, while leaving it the ability to process events, for example, clicking on her.
Conclusion
So what is javascript? This is an easy-to-learn scripting language that is used on almost every site or web service on the Internet. Based on it, libraries are created and promoted that extend the functionality and simplify development. The standard JavaScript capabilities are quite enough for most tasks related not only to web programming, but also to application solutions.