You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/1-intro/article.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
-
# An Introduction to JavaScript
1
+
# JavaScript-ə giriş
2
2
3
3
Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
4
4
5
5
## What is JavaScript?
6
6
7
-
*JavaScript* was initially created to *"make web pages alive"*.
7
+
_JavaScript_ was initially created to _"make web pages alive"_.
8
8
9
-
The programs in this language are called *scripts*. They can be written right in a web page's HTML and run automatically as the page loads.
9
+
The programs in this language are called _scripts_. They can be written right in a web page's HTML and run automatically as the page loads.
10
10
11
11
Scripts are provided and executed as plain text. They don't need special preparation or compilation to run.
12
12
13
-
In this aspect, JavaScript is very different from another language called [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).
13
+
In this aspect, JavaScript is very different from another language called [Java](<https://en.wikipedia.org/wiki/Java_(programming_language)>).
14
14
15
15
```smart header="Why <u>Java</u>Script?"
16
16
When JavaScript was created, it initially had another name: "LiveScript". But Java was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
@@ -24,7 +24,7 @@ The browser has an embedded engine sometimes called a "JavaScript virtual machin
24
24
25
25
Different engines have different "codenames". For example:
26
26
27
-
-[V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
27
+
-[V8](<https://en.wikipedia.org/wiki/V8_(JavaScript_engine)>) -- in Chrome and Opera.
28
28
-[SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
29
29
- ...There are other codenames like "Trident" and "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
30
30
@@ -53,7 +53,7 @@ For instance, in-browser JavaScript is able to:
53
53
54
54
- Add new HTML to the page, change the existing content, modify styles.
55
55
- React to user actions, run on mouse clicks, pointer movements, key presses.
56
-
- Send requests over the network to remote servers, download and upload files (so-called [AJAX](https://en.wikipedia.org/wiki/Ajax_(programming)) and [COMET](https://en.wikipedia.org/wiki/Comet_(programming)) technologies).
56
+
- Send requests over the network to remote servers, download and upload files (so-called [AJAX](<https://en.wikipedia.org/wiki/Ajax_(programming)>) and [COMET](<https://en.wikipedia.org/wiki/Comet_(programming)>) technologies).
57
57
- Get and set cookies, ask questions to the visitor, show messages.
58
58
- Remember the data on the client-side ("local storage").
59
59
@@ -65,14 +65,16 @@ Examples of such restrictions include:
65
65
66
66
- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS system functions.
67
67
68
-
Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `<input>` tag.
68
+
Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `<input>` tag.
69
+
70
+
There are ways to interact with camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
69
71
70
-
There are ways to interact with camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
71
72
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port).
72
73
73
-
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
74
+
This is called the "Same Origin Policy". To work around that, _both pages_ must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
75
+
76
+
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com` and steal information from there.
74
77
75
-
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com` and steal information from there.
76
78
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
77
79
78
80

@@ -81,13 +83,14 @@ Such limits do not exist if JavaScript is used outside of the browser, for examp
81
83
82
84
## What makes JavaScript unique?
83
85
84
-
There are at least *three* great things about JavaScript:
86
+
There are at least _three_ great things about JavaScript:
85
87
86
88
```compare
87
89
+ Full integration with HTML/CSS.
88
90
+ Simple things are done simply.
89
91
+ Support by all major browsers and enabled by default.
90
92
```
93
+
91
94
JavaScript is the only browser technology that combines these three things.
92
95
93
96
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.
@@ -100,7 +103,7 @@ The syntax of JavaScript does not suit everyone's needs. Different people want d
100
103
101
104
That's to be expected, because projects and requirements are different for everyone.
102
105
103
-
So recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
106
+
So recently a plethora of new languages appeared, which are _transpiled_ (converted) to JavaScript before they run in the browser.
104
107
105
108
Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and auto-converting it "under the hood".
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/2-manuals-specifications/article.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
+
# Nizamnamə və spesifikasiyalar
1
2
2
-
# Manuals and specifications
3
-
4
-
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources.
3
+
This book is a _tutorial_. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources.
5
4
6
5
## Specification
7
6
@@ -19,14 +18,13 @@ Also, if you're in developing for the browser, then there are other specs covere
19
18
20
19
-**MDN (Mozilla) JavaScript Reference** is a manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
21
20
22
-
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
23
-
24
-
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for `parseInt` function.
21
+
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
25
22
23
+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for `parseInt` function.
26
24
27
-
-**MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.
25
+
***MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.
28
26
29
-
Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
27
+
Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
Copy file name to clipboardExpand all lines: 1-js/01-getting-started/4-devtools/article.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Developer console
1
+
# Developer konsolu
2
2
3
-
Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)).
3
+
Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are _absolutely_ going to make errors, at least if you're a human, not a [robot](<https://en.wikipedia.org/wiki/Bender_(Futurama)>).
4
4
5
5
But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it.
6
6
@@ -33,7 +33,6 @@ Below the error message, there is a blue `>` symbol. It marks a "command line" w
33
33
34
34
Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>.
35
35
36
-
37
36
## Firefox, Edge, and others
38
37
39
38
Most other browsers use `key:F12` to open developer tools.
0 commit comments