Computer literacy, help and repair

How to enable javascript in the browser - Instructions for all versions. What are JavaScripts? Basic Functions of JavaScript What is a java script and why is it needed

JavaScript® (often shortened to JS) is an interpreted programming language designed to interact with web pages. JavaScript runs on the client side of the web and is used to program how web pages will behave when certain events occur.

What is JavaScript?

JavaScript is a cross-platform, object-oriented scripting language that adds interactivity and responsiveness to your web pages.

JavaScript allows a website developer to control how a web page behaves. This makes JavaScript fundamentally different from HTML, the language that is responsible for the structure of a web document, and CSS, the language that shapes the appearance of web pages.

Programs written in JavaScript are called scripts. In the browser, they are connected directly to the HTML document and, as soon as the page is loaded, they are immediately executed. The process of executing a script is called "interpretation".

If the PHP script is processed on the server side using the PHP interpreter, then the JavaScript is executed in the user's browser by the JavaScript interpreter.

Today, every browser supports JavaScript, thus making it the language of the web.

In the browser, JavaScript can do everything related to manipulating the HTML document, interacting with the visitor, and, with some limitations, with the server:

  • Validate that custom HTML forms are filled in correctly.
  • Interact with webcam, microphone and other devices.
  • Change styles of HTML elements, hide, show elements, etc.
  • Display pop-ups and dialog boxes.
  • Respond to visitor actions, handle mouse clicks, cursor movements, etc.
  • Send requests to the server and download data without reloading the page.

JavaScipt is an incredibly powerful and efficient language that you should definitely try out!

JavaScript versus ECMAScript

This tutorial is written about the language known as JavaScript. However, the official standard that defines the specifications that describe the language calls it ECMAScript.

Netscape introduced the JavaScript language to Ecma International, an organization dedicated to standardizing information and communication systems (ECMA was originally an acronym for the European Computer Manufacturers Association), where it was approved as an ECMAScript standard in 1997.

This standardized version of JavaScript, called ECMAScript, works the same in all applications that support the standard. Developers can use the language's open standard to develop their own JavaScript implementation.

Formally, when developers refer to ECMAScript, they usually mean the "ideal" language defined by the Ecma standard. Most often, these two concepts are interchangeable. Therefore, when referring to the official standard in this tutorial, the name ECMAScript will be used, and in other cases, when referring to the language, JavaScript. The tutorial will also use the commonly accepted abbreviation ES5 when referring to the fifth edition of the ECMAScript standard.

JavaScript is not Java

Before you start learning JavaScript, you should understand that JavaScript is not Java. These are two completely different programming languages. JavaScript has nothing to do with the Java language other than a similar syntax.

Java is an object-oriented programming language developed by Sun Microsystems since 1991 and officially released on May 23, 1995. Java is a powerful and much more complex programming language, and you can write a wide variety of programs in it. For web pages, there is a special opportunity - writing applets.

An applet is a Java program that can be connected to HTML using the tag . Java applets are run using a compiler. Java applets are embedded in a web page but stored on disk as separate files. These are binaries, and if you open them, you won't see the source code for the applet.

JavaScript scripts are hosted within a web page and cannot exist separately from it. JS scripts do not require a compiler to execute, they are executed by the browser on the user's side. JS script is plain text and you can view the code with the naked eye - without any special software.

Java is a class-based language that is fast, secure, and reliable. Java's class-oriented model means that programs consist solely of classes and their methods. Class inheritance and strong typing in the Java language typically require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript programming.

JavaScript is a lightweight programming language that has a simple syntax, specialized built-in functionality, and minimal requirements for creating objects. You do not need to declare variables, classes and methods. You don't have to worry about whether methods are public, private, or protected, and you don't have to implement interfaces. Variables, parameters, and return types of JS scripts are not explicitly typed.

What do you need to learn JavaScript?

Prior knowledge of JavaScript is not required, but since JavaScript resides within web pages and controls their dynamics, it is assumed that you are familiar with the basics of the HTML language, although the possibility of "parallel" and JavaScript is not ruled out.

Most JavaScript scripts are designed to "spice up" HTML, that is, the purpose of writing a script is to demonstrate how the page will change when the HTML tag parameter values ​​change. Put together and properly formatted, these kinds of scripts are an example of a developed web application.

Before we start writing our first JavaScript program, it is very important to make sure that all the necessary tools are set up and in place.

When learning JavaScript, it's very important to run the examples provided in each lesson, modify them, and run them again to check how well you understand the material you've learned. This requires a JavaScript interpreter. Fortunately, as you already know, every web browser includes a JavaScript interpreter.

To write and execute JavaScript programs, it is enough to install any modern Internet browser (for example, Yandex, Internet Explorer, Mozilla Firefox or Google Chrome).

You'll see later in this tutorial that you can embed JavaScript code directly into HTML files, in tags.

And the third way is to add script elements to tags. This option is used to define events (for example, connecting an event that fires on a mouse click).

//comment

JavaScript programming language is an object-oriented scripting language, originally developed by Netscape Communications under the name LiveScript, but later renamed "JavaScript" and, given the syntax closer, this language is closer to Sun Microsystems' Java. JavaScript was later standardized by ECMA under the name ECMAScript. Microsoft calls their versions JScript.

The name change from LiveScript to JavaScript occurred around the same time that Netscape enabled Java technology in the Netscape Navigator browser. This change has caused a lot of confusion in the minds of learners of beginner programming. There is no real connection between Java and JavaScript, their similarities begin and end with similar syntax and the fact that both languages ​​are widely used on the Internet.

JavaScript is an object-oriented scripting language that interacts through an interface called the Document Object Model (DOM) with content, can be executed on the server side (web servers) and on the client side in the user's web browser while browsing the web. Many websites use client-side JavaScript technologies to create powerful dynamic web applications in programming for dummies. It can use Unicode and can use the power and strength of regular expressions (this was introduced in version 1.2 in Netscape Navigator 4 and Internet Explorer 4). JavaScript expressions contained as a string can be executed using the EVAL function.

One of the main tasks for JavaScript is small functions that are embedded in HTML pages and allow you to interact with the DOM from the browser to perform certain tasks that are not possible in static HTML: such as opening a new window, checking form values, changing the image on hover mice, etc. Unfortunately, creating such functions is quite a tedious task, because browsers are not standardized, different browsers can create different objects or script methods, and therefore it is often necessary to write different versions of a JavaScript function for different browsers, but this is not very convenient when teaching the basics of programming.

JavaScript / ECMAScript is supported by engines such as:

  • Rhino
  • Spider Monkey

Environment

<-! ... ->The markup comment is required to ensure that the code does not appear as text in browsers that do not recognize the tag.

Similar posts