diff --git a/1-js/05-data-types/03-string/article.md b/1-js/05-data-types/03-string/article.md index 8d381f8e24..ef40df83c6 100644 --- a/1-js/05-data-types/03-string/article.md +++ b/1-js/05-data-types/03-string/article.md @@ -186,7 +186,7 @@ for (let char of "Hello") { let str = 'Hi'; str[0] = 'h'; // error -alert( str[0] ); // 无法运行 +alert( str[0] ); // 没成功 ``` 通常的解决方法是创建一个新的字符串,并将其分配给 `str` 而不是以前的字符串。 diff --git a/1-js/05-data-types/04-array/article.md b/1-js/05-data-types/04-array/article.md old mode 100644 new mode 100755 diff --git a/1-js/05-data-types/05-array-methods/article.md b/1-js/05-data-types/05-array-methods/article.md old mode 100644 new mode 100755 diff --git a/1-js/05-data-types/06-iterable/article.md b/1-js/05-data-types/06-iterable/article.md old mode 100644 new mode 100755 diff --git a/1-js/05-data-types/07-map-set/article.md b/1-js/05-data-types/07-map-set/article.md old mode 100644 new mode 100755 diff --git a/1-js/05-data-types/08-weakmap-weakset/article.md b/1-js/05-data-types/08-weakmap-weakset/article.md old mode 100644 new mode 100755 diff --git a/1-js/05-data-types/12-json/article.md b/1-js/05-data-types/12-json/article.md old mode 100644 new mode 100755 diff --git a/1-js/06-advanced-functions/04-var/article.md b/1-js/06-advanced-functions/04-var/article.md old mode 100644 new mode 100755 diff --git a/1-js/06-advanced-functions/06-function-object/article.md b/1-js/06-advanced-functions/06-function-object/article.md old mode 100644 new mode 100755 diff --git a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md old mode 100644 new mode 100755 diff --git a/1-js/06-advanced-functions/09-call-apply-decorators/article.md b/1-js/06-advanced-functions/09-call-apply-decorators/article.md old mode 100644 new mode 100755 diff --git a/1-js/06-advanced-functions/10-bind/article.md b/1-js/06-advanced-functions/10-bind/article.md old mode 100644 new mode 100755 diff --git a/2-ui/2-events/02-bubbling-and-capturing/both.view/script.js b/2-ui/2-events/02-bubbling-and-capturing/both.view/script.js old mode 100644 new mode 100755 index c3475f5cbb..79195638d7 --- a/2-ui/2-events/02-bubbling-and-capturing/both.view/script.js +++ b/2-ui/2-events/02-bubbling-and-capturing/both.view/script.js @@ -7,6 +7,6 @@ for (let i = 0; i < elems.length; i++) { function highlightThis() { this.style.backgroundColor = 'yellow'; - alert(this.tagName); + console.log(this.tagName); this.style.backgroundColor = ''; } \ No newline at end of file diff --git a/2-ui/2-events/02-bubbling-and-capturing/bubble-target.view/script.js b/2-ui/2-events/02-bubbling-and-capturing/bubble-target.view/script.js old mode 100644 new mode 100755 index b1353712fa..24f586d594 --- a/2-ui/2-events/02-bubbling-and-capturing/bubble-target.view/script.js +++ b/2-ui/2-events/02-bubbling-and-capturing/bubble-target.view/script.js @@ -4,7 +4,7 @@ form.onclick = function(event) { // chrome needs some time to paint yellow setTimeout(() => { - alert("target = " + event.target.tagName + ", this=" + this.tagName); + console.log("target = " + event.target.tagName + ", this=" + this.tagName); event.target.style.backgroundColor = '' }, 0); }; diff --git a/2-ui/2-events/02-bubbling-and-capturing/capture.view/script.js b/2-ui/2-events/02-bubbling-and-capturing/capture.view/script.js old mode 100644 new mode 100755 index d67a496ad7..a82d2b8796 --- a/2-ui/2-events/02-bubbling-and-capturing/capture.view/script.js +++ b/2-ui/2-events/02-bubbling-and-capturing/capture.view/script.js @@ -6,6 +6,6 @@ for (let i = 0; i < elems.length; i++) { function highlightThis() { this.style.backgroundColor = 'yellow'; - alert(this.tagName); + console.log(this.tagName); this.style.backgroundColor = ''; } \ No newline at end of file diff --git a/2-ui/2-events/03-event-delegation/article.md b/2-ui/2-events/03-event-delegation/article.md index 5c015c8884..5f2e53c189 100644 --- a/2-ui/2-events/03-event-delegation/article.md +++ b/2-ui/2-events/03-event-delegation/article.md @@ -199,7 +199,7 @@ One more counter: ``` -如果我们点击按钮 —— 它的值就会增加。但不仅仅是按钮,一般的方法在这里也很重要。 +如果我们点击按钮 —— 它的值就会增加。这里重要的不是按钮,而是这种通用方法。 我们可以根据需要使用 `data-counter` 特性,多少都可以。我们可以随时向 HTML 添加新的特性。使用事件委托,我们属于对 HTML 进行了“扩展”,添加了描述新行为的特性。 diff --git a/2-ui/4-forms-controls/2-focus-blur/article.md b/2-ui/4-forms-controls/2-focus-blur/article.md index ac3a48062b..fdd5675a41 100644 --- a/2-ui/4-forms-controls/2-focus-blur/article.md +++ b/2-ui/4-forms-controls/2-focus-blur/article.md @@ -90,7 +90,7 @@ Your email please: 请注意,我们无法通过在 `onblur` 事件处理程序中调用 `event.preventDefault()` 来“阻止失去焦点”,因为 `onblur` 事件处理程序是在元素失去焦点 **之后** 运行的。 -但在实际中,在实现这样的功能之前应该认真考虑一下,因为我们通常 **应该将报错展示给用户**,但 **不应该阻止用户在填写我们的表单时的进度**。用户可能会想先填写其他表单项。 +但在实际中,在实现这样的功能之前应该认真考虑一下,因为我们通常 **应该将报错展示给用户**,但 **不应该阻止用户填写表单的进程**。用户可能会想先填写其他表单项。 ```warn header="JavaScript 导致的焦点丢失" 很多种原因可以导致焦点丢失。 diff --git a/2-ui/4-forms-controls/3-events-change-input/article.md b/2-ui/4-forms-controls/3-events-change-input/article.md index 42c0518d26..5c3ece09a1 100644 --- a/2-ui/4-forms-controls/3-events-change-input/article.md +++ b/2-ui/4-forms-controls/3-events-change-input/article.md @@ -95,7 +95,7 @@ 因此,大多数浏览器仅允许在某些用户操作范围内(例如复制/粘贴等)对剪切板进行无缝的读/写访问。 -除火狐(Firefox)浏览器外,所有浏览器都禁止使用 `dispatchEvent` 生成“自定义”剪贴板事件,即使我们设法调度此类事件。规范也明确声明了,合成(syntetic)事件不得提供对剪切板的访问权限。 +除火狐(Firefox)浏览器外,所有浏览器都禁止使用 `dispatchEvent` 生成“自定义”剪贴板事件,即使我们设法调度此类事件。规范也明确声明了,合成(synthetic)事件不得提供对剪切板的访问权限。 此外,如果有人想将 `event.clipboardData` 保存在事件处理程序中,然后稍后再访问它 —— 这也不会生效。 diff --git a/2-ui/5-loading/01-onload-ondomcontentloaded/article.md b/2-ui/5-loading/01-onload-ondomcontentloaded/article.md index 7e74ce690f..c4d77ced3f 100644 --- a/2-ui/5-loading/01-onload-ondomcontentloaded/article.md +++ b/2-ui/5-loading/01-onload-ondomcontentloaded/article.md @@ -101,7 +101,7 @@ document.addEventListener("DOMContentLoaded", ready); Firefox,Chrome 和 Opera 都会在 `DOMContentLoaded` 中自动填充表单。 -例如,如果页面有一个带有登录名和密码的表单,并且浏览器记住了这些值,那么在 `DOMContentLoaded` 上,浏览器会尝试自动填充它们(如果得到了用户允许)。 +例如,如果页面有一个带有登录名和密码的表单,并且浏览器记住了这些值,那么当 `DOMContentLoaded` 时,浏览器会尝试自动填充它们(如果得到了用户允许)。 因此,如果 `DOMContentLoaded` 被需要加载很长时间的脚本延迟触发,那么自动填充也会等待。你可能在某些网站上看到过(如果你使用浏览器自动填充)—— 登录名/密码字段不会立即自动填充,而是在页面被完全加载前会延迟填充。这实际上是 `DOMContentLoaded` 事件之前的延迟。 diff --git a/5-network/03-fetch-progress/progress.view/index.html b/5-network/03-fetch-progress/progress.view/index.html index ba7f76065e..0da4c184c8 100644 --- a/5-network/03-fetch-progress/progress.view/index.html +++ b/5-network/03-fetch-progress/progress.view/index.html @@ -1,6 +1,6 @@