ComputersSoftware

What is JavaScripts? Basic JavaScript functions

Web scripts are programs that are written directly in the html code or simply in files, which is more preferable. These programs are written in JavaScript. Thus, speaking of what Javascripts are, you can say that it is a programming language that is interpretive.

The Java script is read by the browser, and then the recorded expressions are executed and the manipulations that are set above the page are performed. JavaScript is similar in its syntax to programming languages like Java, C ++ and C.

JavaScript owes its development to the development of companies such as Sun Microsystems (Oracle) and Netscape (Mozilla). The original language name was LiveScript. However, because then Java was very popular with Sun Microsystems, Netscape's marketing department decided to change the name of the language to JavaScript. At the same time, it was calculated that this step would add a language of popularity. Also, when talking about what Javascripts are, you need to note that Java and JavaScript are two different languages.

ECMA-262 is the official standard of this language. The name of this JavaScript language is ECMAScript.



To learn this language, the previous knowledge of CSS and Html will be useful. If before that time you did not know about CSS and Html, you should immediately get acquainted.

Limitations and features of JavaScript

The following options appear when you use [removed] scripts on web pages:

  • Adding various animation effects that are not implemented using Html and CSS.
  • Ability to change the content of Html elements and add new tags without reloading the page.
  • Responding to events (responding to user actions) - processing keystrokes on the keyboard and moving the mouse cursor.
  • Performing verification of data that was entered in the form fields before sending it to the server. This reduces the load on the server and speeds up the site.
  • Determine the version of the browser and download the required page, depending on this.

This is not a complete list of scripting capabilities that were written in this language, JavaScript functions have a much broader meaning.

In addition to the above opportunities, there are limitations on the use of scenarios:

  • There is no access to files that are hosted on the user's computer. In general, there is no access outside the web page itself. An exception may be only cookies that can be read and written using JavaScript. Objects of this type are usually needed only to make the page load faster.
  • There is no way to perform cross-domain queries, that is, access to web pages that are on a different domain, even if they are open in neighboring tabs.
  • There is no way to close the tabs and windows that opened with it.
  • There is no way to protect the source text on the page and prohibit copying images or text from the page. In this case, it remains possible to add some restrictions, which allow JavaScript functions.

Such restrictions in some ways make it difficult to execute malicious code.

What is Javascripts?

As noted above, JavaScript is a language that gives interactivity to web pages. With this language, those applications are created that are included in the Html code. For example, forms or questionnaires filled out by the user. Quite often the JavaScript language is confused with Java, but there is little in common between these languages.

Some even compare JavaScript with other languages Ruby, Self, Python. But this is a separate language.

Using JavaScript

Using JavaScript, you can make changes to the page, change the element styles, add or remove tags. Also there is an opportunity to learn about the actions of the user on the page (decrease or increase the working area of the screen, clicks with the mouse, pressing any keys, scrolling the page). It is possible to access any element of the Html-code and manipulate this element. Thus, the answer to the question "What is JavaScripts?" Will be the ability to download data without reloading the page, entering messages, setting or reading cookies and performing many other actions.

The basis of the uniqueness of JavaScript

The main uniqueness of this language is that it has support for almost all browsers and has full integration with them. All actions using JavaScript are very simple. There is no other technology that would contain all such advantages. For example, there are no cross-browsers, they do not support all browsers (this is XUL, ActiveX, VBScript). There are also some that are not fully integrated with the browser. This is Silverlight, Flash, Java. At the moment, there is a great development of this technology and in development are the elements of JavaScript 2.

Alternative programming languages

It happens that the possibilities of JavaScript are limited. In this case, the following programming languages will help.

Java

The most used language is Java. This language describes complex algorithms, but this is not always required on a regular site. For this reason, java-applet's are loaded for a long time and have a considerable volume.

Flash

From the very beginning, the Flash language was designed as a cross-browser and for creating multimedia objects. For example, to create interactive areas on the site, games, banners, players for audio and video. Among other things, using Flash you create sockets (connections on the network), you can work with multimedia, store objects that do not need to send requests to the server. There are convenient graphical development tools for Flash.

If you compare the disadvantages of Flash and JavaScript, whose objects are very different, the main disadvantage of Flash is its poor indexing by search engines. This is because the search engines follow the Html links. It is also not possible to select text that is in the Flash container.

Silverlight, Vbscript, JavaFX, XUL

In order to supplement the JavaScript capabilities for building interfaces and communication areas, Silverlight, Vbscript, JavaFX, XUL technologies are used.
They are used anyway more rarely than Flash and JavaScript. To distinguish the characteristics of each of them, we can say the following:

- XUL - used when describing desktop applications and interfaces. But it is possible only if you create a program under Mozilla.

- JavaFX - works on the computer only with Java, as it is an addition to this language.

- Vbscript - was developed by Microsoft Corporation. The basis was served by Visual Basic. This language does not develop in any way, these days it is almost not used, JavaScript is inferior in capabilities.

Silverlight - was developed by Microsoft as a competitor for Flash. He also does not have much popularity, because JavaScript strings can provide much more page scripts.

How to enable JavaScript and what is JavaScript error

Now it is worth discussing the everyday problems of users on the network. Today, more and more often, a user after visiting his page in social. Network sees in the top window the error message "JavaScript is not enabled", "For the correct operation of the site, enable JavaScript", "JavaScript error". How to fix this is a serious question, because While there are difficulties with downloading videos and photos from the user.

How JavaScript works in Mozilla Firefox

If the user is working in Mozilla, you need to go to "Tools", then in "Settings". Then on the "Content" tab, check the box next to "Use JavaScript".

How JavaScript works in Google Chrom

To enable or disable JavaScript in this browser, you need the following steps: "Configure and manage Google Chrom", "Options", "Advanced", "Personal data (content settings)", "JavaScript". Allow all sites to use JavaScript (recommended).

How JavaScript works in Opera

To enable or disable JavaScript in this browser, you must do the following:

- Press the F12 key.

- Select "Enable JavaScript".

How JavaScript is included in IE ("Internet Explorer")

To enable or disable JavaScript in Internet Explorer, you need to do the following: "Tools", "Internet Options", "Security" tab, "Select Internet zone", "Other", "Scripts", "Allow scripts".

JavaScript in VK

Extremely popular in the CIS sotsset "VKontakte" often presents unpleasant surprises. Increasingly, VKontakte users complain about the impossibility of listening to audio or the inability to watch video.

To solve this problem, you need a JavaScript error correction on the VKontakte network.

What is a JavaScript VK error?

The user visited his page in the social network and tried to run a video or audio file, but after that he found the inscription "JavaScript error: initAddMedia is not defined" in the upper left corner. This message appears on error
"[Removed] initAddMedia".

Methods for solving the problem with an error in the social network "VKontakte":

- First you need to go to "Start", "My Computer" and the Windows folder. Then go to the system32 partition and the driver folder. Then into the folder etc.

- In the middle of a small number of files in this folder, you need to select the hosts file.
This file is then opened with Notepad. It looks like this: you need to right-click on the hosts file and select "Open with". Then you can select "WordPad Text Editor".

After opening this file, you need to look at the file with the 127.0.0.1 localhost entry. Any other record is superfluous and only hinders and blocks the stable operation of audio and video files. It is necessary to delete all the information from the file completely and copy only this inscription 127.0.0.1 localhost. Then click "Save" and restart the computer. When you visit the VKontakte page, everything will work fine.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.