-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translation_ajax #73
Open
XERO75
wants to merge
3
commits into
FreeCodeCampChina:translate
Choose a base branch
from
XERO75:translation_ajax
base: translate
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
translation_ajax #73
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,21 +13,21 @@ | |
"id": "587d7fad367417b2b2512be1", | ||
"title": "Handle Click Events with JavaScript using the onclick property", | ||
"description": [ | ||
"You want your code to execute only once your page has finished loading. For that purpose, you can attach a JavaScript event to the document called <code>DOMContentLoaded</code>. Here's the code that does this:", | ||
"你希望代码仅在页面完成加载后执行。为此,你可将名为<code>DOMContentLoaded</code>的 JavaScript 事件附加到文档中。如例:", | ||
"<blockquote>document.addEventListener('DOMContentLoaded',function() {<br><br>});</blockquote>", | ||
"You can implement event handlers that go inside of the <code>DOMContentLoaded</code> function. You can implement an <code>onclick</code> event handler which triggers when the user clicks on the element with id <code>getMessage</code>, by adding the following code:", | ||
"你可以执行在<code>DOMContentLoaded</code>函数内部的事件处理程序。添加<code>onclick</code>事件处理器,当用户点击 id 为<code>getMessage</code>的元素时会触发事件。添加以下代码:", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 语句不通 |
||
"<blockquote>document.getElementById('getMessage').onclick=function(){};</blockquote>", | ||
"<hr>", | ||
"Add a click event handler inside of the <code>DOMContentLoaded</code> function for the element with id of <code>getMessage</code>." | ||
"在<code>DOMContentLoaded</code>函数内为 id 为<code>getMessage</code>的元素添加一个 click 事件处理器。" | ||
], | ||
"tests": [ | ||
{ | ||
"text": "Your code should use the <code>document.getElementById</code> method to select the <code>getMessage</code> element.", | ||
"testString": "assert(code.match(/document\\.getElementById\\(\\s*?('|\")getMessage\\1\\s*?\\)/g), 'Your code should use the <code>document.getElementById</code> method to select the <code>getMessage</code> element.');" | ||
"text": "你的代码应该用<code>document.getElementById</code>方法来选择<code>getMessage</code>元素。", | ||
"testString": "assert(code.match(/document\\.getElementById\\(\\s*?('|\")getMessage\\1\\s*?\\)/g), '你的代码应该用<code>document.getElementById</code>方法来选择<code>getMessage</code>元素。');" | ||
}, | ||
{ | ||
"text": "Your code should add an <code>onclick</code> event handler.", | ||
"testString": "assert(typeof document.getElementById('getMessage').onclick === 'function', 'Your code should add an <code>onclick</code> event handler.');" | ||
"text": "你的代码应该添加<code>onclick</code>事件处理器。", | ||
"testString": "assert(typeof document.getElementById('getMessage').onclick === 'function', '你的代码应该添加<code>onclick</code>事件处理器。');" | ||
} | ||
], | ||
"solutions": [], | ||
|
@@ -42,10 +42,10 @@ | |
"contents": [ | ||
"<script>", | ||
" document.addEventListener('DOMContentLoaded',function(){", | ||
" // Add your code below this line", | ||
" // 在该行下添加代码", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 在该行下添加代码 => 在这行下面添加代码 |
||
" ", | ||
" ", | ||
" // Add your code above this line", | ||
" // 在该行上添加代码", | ||
" });", | ||
"</script>", | ||
"<style>", | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如例???