Skip to content

Commit 37ec7ef

Browse files
authored
Update article.md
1 parent 6ef9dfb commit 37ec7ef

1 file changed

Lines changed: 18 additions & 18 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: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,51 +60,51 @@ alert(`Тебе ${age} лет!`); // Тебе 100 лет!
6060
let test = prompt("Test");
6161
```
6262
63-
So, for prompts to look good in IE, we recommend always providing the second argument:
63+
Для более лаконичного отображения, реккомендуется всегда указывать второй параметр:
6464
6565
```js run
66-
let test = prompt("Test", ''); // <-- for IE
66+
let test = prompt("Test", ''); // <-- для IE
6767
```
6868
````
6969

7070
## confirm
7171

72-
The syntax:
72+
Синтаксис:
7373

7474
```js
7575
result = confirm(question);
7676
```
7777

78-
The function `confirm` shows a modal window with a `question` and two buttons: OK and CANCEL.
78+
Функция `confirm` отображает модальное окно с текстом вопроса `question` и двумя кнопками: OK и CANCEL.
7979

80-
The result is `true` if OK is pressed and `false` otherwise.
80+
Результат `true` если нажата кнопка OK. В других случаях `false`.
8181

82-
For example:
82+
Например:
8383

8484
```js run
85-
let isBoss = confirm("Are you the boss?");
85+
let isBoss = confirm("Ты тут главный?");
8686

87-
alert( isBoss ); // true if OK is pressed
87+
alert( isBoss ); // `true` если нажата OK
8888
```
8989

90-
## Summary
90+
## Резюме
9191

92-
We covered 3 browser-specific functions to interact with visitors:
92+
Рассмотрели 3 функции браузера для взаимодействия с пользователем:
9393

9494
`alert`
95-
: shows a message.
95+
: показывает сообщение.
9696

9797
`prompt`
98-
: shows a message asking the user to input text. It returns the text or, if CANCEL or `key:Esc` is clicked, `null`.
98+
: показывает сообщение и запрашивает ввод текста от пользователя. Возвращает напечатанный текст в поле ввода или `null` если были нажаты кнопки CANCEL или `Esc` с клавиатуры.
9999

100100
`confirm`
101-
: shows a message and waits for the user to press "OK" or "CANCEL". It returns `true` for OK and `false` for CANCEL/`key:Esc`.
101+
: показывает сообщение и ждет пока пользователь нажмет OK или CANCEL. Возращает `true` если нажата OK и `false` если нажаты кнопки CANCEL или `Esc` с клавиатуры.
102102

103-
All these methods are modal: they pause script execution and don't allow the visitor to interact with the rest of the page until the window has been dismissed.
103+
Все эти методы являются модальными: останавливают выполнение скриптов и не позволяют пользователю взаимодействовать с остальной частью страницы до тех пор, пока окно не будет закрыто.
104104

105-
There are two limitations shared by all the methods above:
105+
На все указанные методы распространяется два ограничения:
106106

107-
1. The exact location of the modal window is determined by the browser. Usually, it's in the center.
108-
2. The exact look of the window also depends on the browser. We can't modify it.
107+
1. Расположение окон определяется браузеров. Обычно окна рассположены в центре.
108+
2. Визуальное отображение окон зависит от браузера и мы не можем изменит их вид.
109109

110-
That is the price for simplicity. There are other ways to show nicer windows and richer interaction with the visitor, but if "bells and whistles" do not matter much, these methods work just fine.
110+
Такова цена простоты. Есть другие способы показать более приятные глазу окна с богатым функционалом для взаимодействия с пользователем, но если "навороты" не имеют значеня, то данные методы работают отлично.

0 commit comments

Comments
 (0)