up
This commit is contained in:
parent
20784e7f26
commit
7019d1470d
48 changed files with 1019 additions and 464 deletions
|
@ -130,7 +130,7 @@ The example above can be split into two scripts to work:
|
|||
|
||||
- We can use a `<script>` tag to add JavaScript code to the page.
|
||||
- The `type` and `language` attributes are not required.
|
||||
- Scripts in an external file can be inserted on the page via `<script src="path"></script>`.
|
||||
- A script in an external file can be inserted with `<script src="path/to/script.js"></script>`.
|
||||
|
||||
|
||||
There is much more about browser scripts and their interaction with the web-page. But let's keep in mind that this part of the tutorial is devoted to Javascript language. So we shouldn't distract ourselves from it. We'll be using a browser as a way to run Javascript, very convenient for online reading, but yet one of many.
|
||||
|
|
|
@ -218,7 +218,7 @@ let age = prompt('Your age?', 18);
|
|||
|
||||
switch (age) {
|
||||
case 18:
|
||||
alert("Won't work"); // the result of prompt is a string, not a number число
|
||||
alert("Won't work"); // the result of prompt is a string, not a number
|
||||
|
||||
case "18":
|
||||
alert("This works!"");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue