Skip to content

07-修改文档#194

Merged
leviding merged 11 commits intojavascript-tutorial:zh-hansfrom
D-kylin:translate-07-modifying-document
Oct 9, 2018
Merged

07-修改文档#194
leviding merged 11 commits intojavascript-tutorial:zh-hansfrom
D-kylin:translate-07-modifying-document

Conversation

@D-kylin
Copy link
Contributor

@D-kylin D-kylin commented Aug 14, 2018

resolve #133
@leviding

@leviding
Copy link
Member

@D-kylin 这次对了,辛苦了

@lihanxiang
Copy link
Contributor

校对认领 @leviding

@leviding
Copy link
Member

leviding commented Oct 1, 2018

@lihanxiang ok

Copy link
Contributor

@lihanxiang lihanxiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

校对完毕 @leviding
请注意标点符号 @D-kylin

---

# createTextNode vs innerHTML vs textContent
# 对比 createTextNode,innerHTMLtextContent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

个人感觉要把逗号换成顿号:
对比 createTextNode、innerHTML 和 textContent

首先,使用 HTML/CSS

Each component of the time would look great in its own `<span>`:
每个时间组件都限制在 `<span>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“每个时间组件都限制在 <span>” => “每个时间组件在其 <span> 标签中看起来很棒 ”

---

# Insert the HTML in the list
# HTML 中插入列表
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是在 HTML 中插入列表,还是在列表中插入 HTML?

```

And also there's a simpler way to do the same:
这里还有一种更简便的方法,也能达到我们需要的效果。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

。 => :

所有元素应该都是动态创建的。

If a user types HTML-tags, they should be treated like a text.
如果把用户比作 HTML 标签,那应该相当于一个文本。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果用户输入了 HTML 标签,就应该将其视为文本

如果我们想要**移动**一个元素到另一个地方 —— 不需要移除旧的元素。

**All insertion methods automatically remove the node from the old place.**
**所有插入操作都会从节点原来的位置把节点移除掉**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾的句号

现代的脚本已经很少再看到这个方法,因为使用它有一个很重要的局限性:

**The call to `document.write` only works while the page is loading.**
**只能在页面加载的时候调用 `document.write`**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾的句号

// document.write after 1 second
// that's after the page loaded, so it erases the existing content
// 在一秒后调用 document.write
// 页面已经加载完毕,所以会被擦除。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾没有句号

- `node.after(...nodes or strings)` –- insert right after `node`,
- `node.replaceWith(...nodes or strings)` –- replace `node`.
- `node.remove()` –- remove the `node`.
- 添加一些节点和字符串
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾的冒号

- `node.remove()` —— 移除 `node`

Text strings are inserted "as text".
把字符串当成“文本”插入
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结尾的句号

@leviding
Copy link
Member

leviding commented Oct 1, 2018

@D-kylin 可以修改了

@leviding leviding added the enhancement New feature or request label Oct 1, 2018
@D-kylin
Copy link
Contributor Author

D-kylin commented Oct 8, 2018

@leviding @lihanxiang 修改完毕,请确认

@leviding leviding added WIP Work in process and removed enhancement New feature or request labels Oct 8, 2018
@leviding leviding merged commit ab70bef into javascript-tutorial:zh-hans Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants