33 lines
1.3 KiB
Markdown
33 lines
1.3 KiB
Markdown
# Hello, JavaScript!
|
|
|
|
The programs in JavaScript are called *scripts*. They can be embedded right into HTML using `<script>` tag and run automatically as the page loads.
|
|
|
|
For example, this HTML-page shows the "Hello" message:
|
|
|
|
```html run
|
|
<!doctype html>
|
|
<script>
|
|
alert("Hello!");
|
|
</script>
|
|
```
|
|
|
|
JavaScript can execute not only in a browser, but also on a server, or actually on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine).
|
|
|
|
Browsers have built-in JavaScript engines, so they can run scripts.
|
|
|
|
We can also run scripts using [Node.js](https://nodejs.org), it's commonly used to build server-side applications.
|
|
|
|
Depending on the environment, JavaScript may provide platform-specific functionality.
|
|
|
|
- In a web browser, JavaScript can manipulate the web-page, send network requests, show messages and so on.
|
|
- Node.js allows to run a web-server.
|
|
|
|
...And so on. Even a coffee machine may include its own JavaScript engine, that could allow us to program its recipes.
|
|
|
|

|
|
|
|
In this tutorial we concentrate on the "core JavaScript", that's the same everywhere.**
|
|
|
|
After you learn it, you can go in any direction: learn browser functionality, how to write servers and so on.
|
|
|
|
Please turn the page to start learning JavaScript!
|