Skip to content

Commit ac7dbb0

Browse files
committed
merging all conflicts
2 parents 9876c71 + 2020876 commit ac7dbb0

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

1-js/01-getting-started/1-intro/article.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@
7474

7575

7676

77+
<<<<<<< HEAD
7778
- بىر تور بەتتىكى JavaScript قاتتىق دىسكىدا خالىغانچە ھۆججەتلەرنى ئوقۇمايدۇ/ يازمايدۇ، كۆچۈرۈپ چاپلىمايدۇ ياكى پىروگراممىلارنى ئىجرا قىلمايدۇ. ئۇنىڭ OS (مەشغۇلات سىستېمىسى) ئىقتىدارىغا بىۋاسىتە كىرىش ئىجازىتى يوق.
79+
=======
80+
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`, for example, and steal information from there.
81+
- 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 severely limited. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
82+
>>>>>>> 20208769e528337949e946f526534d61d38bac47
7883
7984
ھازىرقى زامان تور كۆرگۈچلەر ھۆججەتلەرنى ئىشلىتىشكە يول قويىدۇ، ئەمما زىيارەت قىلىش چەكلىك ھەم پەقەت ئىشلەتكۈچى مەلۇم مەشغۇلاتلارنى قىلغاندىلا ئاندىن بۇ ئىقتىدارنى تەمىنلەيدۇ، مەسىلەن، ھۆججەتنى تور كۆرگۈچ كۆزنىكىگە «تاشلاش» ياكى `<input>` خەتكۈش ئارقىلىق تاللاش دېگەندەك.
8085

1-js/02-first-steps/15-function-basics/4-pow/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function pow(x, n) {
1010
return result;
1111
}
1212

13-
let x = prompt("x?", '');
14-
let n = prompt("n?", '');
13+
let x = +prompt("x?", '');
14+
let n = +prompt("n?", '');
1515

1616
if (n < 1) {
1717
alert(`Power ${n} is not supported, use a positive integer`);

2-ui/99-ui-misc/01-mutation-observer/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ Such snippet in an HTML markup looks like this:
128128
...
129129
```
130130

131-
For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElem(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.
131+
For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElement(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.
132132

133-
When exactly should we run that highlighting method? Well, we can do it on `DOMContentLoaded` event, or put the script at the bottom of the page. The moment our DOM is ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElem` on them:
133+
When exactly should we run that highlighting method? Well, we can do it on `DOMContentLoaded` event, or put the script at the bottom of the page. The moment our DOM is ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElement` on them:
134134

135135
```js
136136
// highlight all code snippets on the page
137-
document.querySelectorAll('pre[class*="language"]').forEach(Prism.highlightElem);
137+
document.querySelectorAll('pre[class*="language"]').forEach(elem => Prism.highlightElement(elem));
138138
```
139139

140140
Everything's simple so far, right? We find code snippets in HTML and highlight them.
@@ -146,9 +146,9 @@ let article = /* fetch new content from server */
146146
articleElem.innerHTML = article;
147147
```
148148

149-
The new `article` HTML may contain code snippets. We need to call `Prism.highlightElem` on them, otherwise they won't get highlighted.
149+
The new `article` HTML may contain code snippets. We need to call `Prism.highlightElement` on them, otherwise they won't get highlighted.
150150

151-
**Where and when to call `Prism.highlightElem` for a dynamically loaded article?**
151+
**Where and when to call `Prism.highlightElement` for a dynamically loaded article?**
152152

153153
We could append that call to the code that loads an article, like this:
154154

@@ -158,7 +158,7 @@ articleElem.innerHTML = article;
158158

159159
*!*
160160
let snippets = articleElem.querySelectorAll('pre[class*="language-"]');
161-
snippets.forEach(Prism.highlightElem);
161+
snippets.forEach(elem => Prism.highlightElement(elem));
162162
*/!*
163163
```
164164

0 commit comments

Comments
 (0)