Skip to content

Commit 12b5f26

Browse files
authored
Update article.md
1 parent 7b37e60 commit 12b5f26

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

  • 1-js/02-first-steps/09-alert-prompt-confirm

1-js/02-first-steps/09-alert-prompt-confirm/article.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
1-
# Interaction: alert, prompt, confirm
1+
# Взаимодействие: alert, prompt, confirm
22

3-
This part of the tutorial aims to cover JavaScript "as is", without environment-specific tweaks.
3+
В этой части учебника используется JavaScript "из коробки" без специфических настроек окружения.
4+
5+
Но мы продолжим использовать браузер как демо-среду, поэтому мы должны освосить по крайней мере несколько функций его пользовательского интерфейса. В этой части ознакомимся с такими функциями браузера как `alert`, `prompt` и `confirm`.
46

5-
But we'll still be using the browser as our demo environment, so we should know at least a few of its user-interface functions. In this chapter, we'll get familiar with the browser functions `alert`, `prompt` and `confirm`.
67

78
## alert
89

9-
Syntax:
10+
Синтаксис:
1011

1112
```js
1213
alert(message);
1314
```
1415

15-
This shows a message and pauses script execution until the user presses "OK".
16+
Этот код отобразит окно в браузере и приостановит дальнейшее выполнение скриптов, до тех пор пока пользователь не нажмет кнопку "OK".
1617

17-
For example:
18+
Например:
1819

1920
```js run
2021
alert("Hello");
2122
```
2223

23-
The mini-window with the message is called a *modal window*. The word "modal" means that the visitor can't interact with the rest of the page, press other buttons, etc. until they have dealt with the window. In this case -- until they press "OK".
24+
Это небольшое окно с сообщением называется *модальным окном*. Понятие *модальный* означает, что пользователь не может взаимодействовать с интерфейсом остальной части страницы, нажимать на другие кнопки и т.д. до тех пор, пока взаимодействует с окном. В данном случае -- пока не будет нажата кнопка "OK".
2425

2526
## prompt
2627

27-
The function `prompt` accepts two arguments:
28+
Функция `prompt` принимает два аргумента:
2829

2930
```js no-beautify
3031
result = prompt(title, [default]);
3132
```
3233

33-
It shows a modal window with a text message, an input field for the visitor, and the buttons OK/CANCEL.
34+
Этот код отобразит модальное окно с текстом, полем для ввода текста и кнопками OK/CANCEL.
3435

3536
`title`
36-
: The text to show the visitor.
37+
: Текст для отображения в окне.
3738

3839
`default`
39-
: An optional second parameter, the initial value for the input field.
40+
: Необязательный второй параметр, который устанавливает начальное значение в поле для ввода текста в окне.
4041

41-
The visitor may type something in the prompt input field and press OK. Or they can cancel the input by pressing CANCEL or hitting the `key:Esc` key.
42+
Пользователь может напечатать что-либо в поле ввода запроса и нажать OK. Или отменить ввод нажатием клавиши CANCEL или нажав клавишу `Esc`.
4243

43-
The call to `prompt` returns the text from the input field or `null` if the input was canceled.
44+
Вызов `prompt` вернет текст указанный в поле для ввода или `null` если ввод отменен пользователем.
4445

4546
For instance:
4647

0 commit comments

Comments
 (0)