From 1ae7bbb3e246a9d3b0632f9752c9b443dcd775f1 Mon Sep 17 00:00:00 2001 From: xero75 Date: Tue, 7 Aug 2018 11:14:29 +0800 Subject: [PATCH 1/3] test1 --- 04-data-visualization/json-apis-and-ajax.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-data-visualization/json-apis-and-ajax.json b/04-data-visualization/json-apis-and-ajax.json index 60ce3f5..4f9c119 100644 --- a/04-data-visualization/json-apis-and-ajax.json +++ b/04-data-visualization/json-apis-and-ajax.json @@ -13,7 +13,7 @@ "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 DOMContentLoaded. Here's the code that does this:", + "你 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 DOMContentLoaded. Here's the code that does this:", "
document.addEventListener('DOMContentLoaded',function() {

});
", "You can implement event handlers that go inside of the DOMContentLoaded function. You can implement an onclick event handler which triggers when the user clicks on the element with id getMessage, by adding the following code:", "
document.getElementById('getMessage').onclick=function(){};
", From 59b238f2b7982d207dfba66cb1a84c33aad9a660 Mon Sep 17 00:00:00 2001 From: xero75 Date: Tue, 7 Aug 2018 19:30:54 +0800 Subject: [PATCH 2/3] translate 1/9 --- 04-data-visualization/json-apis-and-ajax.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/04-data-visualization/json-apis-and-ajax.json b/04-data-visualization/json-apis-and-ajax.json index 4f9c119..73a6d33 100644 --- a/04-data-visualization/json-apis-and-ajax.json +++ b/04-data-visualization/json-apis-and-ajax.json @@ -13,21 +13,21 @@ "id": "587d7fad367417b2b2512be1", "title": "Handle Click Events with JavaScript using the onclick property", "description": [ - "你 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 DOMContentLoaded. Here's the code that does this:", + "你希望代码仅在页面完成加载后执行。为此,你可将名为DOMContentLoaded的 JavaScript 事件附加到文档中。如例:", "
document.addEventListener('DOMContentLoaded',function() {

});
", - "You can implement event handlers that go inside of the DOMContentLoaded function. You can implement an onclick event handler which triggers when the user clicks on the element with id getMessage, by adding the following code:", + "你可以执行在DOMContentLoaded函数内部的事件处理程序。添加onclick事件处理器,当用户点击 id 为getMessage的元素时会触发事件。添加以下代码:", "
document.getElementById('getMessage').onclick=function(){};
", "
", - "Add a click event handler inside of the DOMContentLoaded function for the element with id of getMessage." + "在DOMContentLoaded函数内为 id 为getMessage的元素添加一个 click 事件处理器。" ], "tests": [ { - "text": "Your code should use the document.getElementById method to select the getMessage element.", - "testString": "assert(code.match(/document\\.getElementById\\(\\s*?('|\")getMessage\\1\\s*?\\)/g), 'Your code should use the document.getElementById method to select the getMessage element.');" + "text": "你的代码应该用document.getElementById方法来选择getMessage元素。", + "testString": "assert(code.match(/document\\.getElementById\\(\\s*?('|\")getMessage\\1\\s*?\\)/g), '你的代码应该用document.getElementById方法来选择getMessage元素。');" }, { - "text": "Your code should add an onclick event handler.", - "testString": "assert(typeof document.getElementById('getMessage').onclick === 'function', 'Your code should add an onclick event handler.');" + "text": "你的代码应该添加onclick事件处理器。", + "testString": "assert(typeof document.getElementById('getMessage').onclick === 'function', '你的代码应该添加onclick事件处理器。');" } ], "solutions": [], @@ -42,10 +42,10 @@ "contents": [ "", "