Merged
Conversation
Member
|
@D-kylin 这次对了,辛苦了 |
Contributor
|
校对认领 @leviding |
Member
|
@lihanxiang ok |
lihanxiang
reviewed
Oct 1, 2018
| --- | ||
|
|
||
| # createTextNode vs innerHTML vs textContent | ||
| # 对比 createTextNode,innerHTML,textContent |
Contributor
There was a problem hiding this comment.
个人感觉要把逗号换成顿号:
对比 createTextNode、innerHTML 和 textContent
| 首先,使用 HTML/CSS。 | ||
|
|
||
| Each component of the time would look great in its own `<span>`: | ||
| 每个时间组件都限制在 `<span>`: |
Contributor
There was a problem hiding this comment.
“每个时间组件都限制在 <span>” => “每个时间组件在其 <span> 标签中看起来很棒 ”
| --- | ||
|
|
||
| # Insert the HTML in the list | ||
| # HTML 中插入列表 |
Contributor
There was a problem hiding this comment.
是在 HTML 中插入列表,还是在列表中插入 HTML?
| ``` | ||
|
|
||
| And also there's a simpler way to do the same: | ||
| 这里还有一种更简便的方法,也能达到我们需要的效果。 |
| 所有元素应该都是动态创建的。 | ||
|
|
||
| If a user types HTML-tags, they should be treated like a text. | ||
| 如果把用户比作 HTML 标签,那应该相当于一个文本。 |
Contributor
There was a problem hiding this comment.
如果用户输入了 HTML 标签,就应该将其视为文本
| 如果我们想要**移动**一个元素到另一个地方 —— 不需要移除旧的元素。 | ||
|
|
||
| **All insertion methods automatically remove the node from the old place.** | ||
| **所有插入操作都会从节点原来的位置把节点移除掉** |
| 现代的脚本已经很少再看到这个方法,因为使用它有一个很重要的局限性: | ||
|
|
||
| **The call to `document.write` only works while the page is loading.** | ||
| **只能在页面加载的时候调用 `document.write`** |
| // document.write after 1 second | ||
| // that's after the page loaded, so it erases the existing content | ||
| // 在一秒后调用 document.write | ||
| // 页面已经加载完毕,所以会被擦除。 |
| - `node.after(...nodes or strings)` –- insert right after `node`, | ||
| - `node.replaceWith(...nodes or strings)` –- replace `node`. | ||
| - `node.remove()` –- remove the `node`. | ||
| - 添加一些节点和字符串 |
| - `node.remove()` —— 移除 `node`。 | ||
|
|
||
| Text strings are inserted "as text". | ||
| 把字符串当成“文本”插入 |
Member
|
@D-kylin 可以修改了 |
Contributor
Author
|
@leviding @lihanxiang 修改完毕,请确认 |
leviding
approved these changes
Oct 9, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve #133
@leviding