ComputersProgramming

The pop-up window is in [removed]. Its types and purposes of creation

It is known that pages of Internet sites are created in hypertext markup language, with which the browser reports basic information about the constituent elements of such a page: their location relative to the browser window and each other, size, order. To "revive" the page of the site and bring it to a colorful form, cascading style sheets are used, usually taken out of the main frame of the page - html-code. The use of html and css makes it possible to realize the most intricate ideas of a web designer. However, such a page, however colorful it may be, is not interactive, that is, unable to communicate with the user sitting in front of the computer monitor.

Any modern site is created using several programming languages, among which JavaScript belongs.

JavaScript (JS) is a programming language used to create interactive web pages. At once it is necessary to remind, that JavaScript and simply Java - two separate languages, carrying out different functions. The basis of JS are scripts - small programs containing a set of specific commands that should be implemented on the site at one time or another. These programs can be placed directly in the body of the main html-document of the page or be taken out of its boundaries into a separate file and connected to it using a special attribute indicating the location of this file. With the help of JS, you can easily "revive" the site page by creating a pop-up welcome window, an active calendar or a clock, a form for writing and sending text, etc.

Let's talk in more detail about pop-up windows written in JavaScript language, which are usually a small rectangle that appears automatically on top of the main browser window when the user performs any manipulations (for example, when you hover over a certain word or picture). In some cases, a pop-up window appears on the monitor screen immediately after opening the site page. In JS, three kinds of such windows are used:

- Signal is applied in those cases when the information indicated in it must be guaranteed to be delivered to the visitor of the site. Further actions on the site in this case are possible only after clicking the "OK" button by the user himself.

- The invitation pop-up window is applied when it is necessary to make sure that the user enters certain data before entering the page of the site.

- The confirmation window can be used to ensure that the user agrees with something. In this case, it will be necessary to click the value "Ok" or "Cancel".

It's quite easy to write a pop-up script. To do this, you must have the original knowledge of the JavaScript language. In order to check whether it works written or not, you need to start any Internet browser. For example, the script: alert ("Hello") will be displayed in Internet Explorer as a window with the word "Hello" on top of its main window. Using JS, you can change the pop-up window (its width, height, location), make it appear not immediately after the visitor has visited the page of the site, and after he made some manipulations on it.

There are many nuances in the development of sites. It should be understood that the interactivity of the resource, of course, attracts the attention of its visitors and places them to itself. However, you should not get too involved in writing scripts, in particular, pop-up windows. They tend to annoy many users. Modern browsers provide for the blocking of such elements of the site page, allowing you to remove pop-up windows by disabling the corresponding function in their menu. If necessary, you need to go back to the menu and restore the ability to display the browser data scripts.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

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