The message will go here
@@ -92,8 +94,54 @@ tests:
## Solution
-```js
-// solution required
+```html
+
+
+
+
+
Cat Photo Finder
+
+ The message will go here
+
+
+
+
+
```
diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/convert-json-data-to-html.english.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/convert-json-data-to-html.english.md
index d4ad797c0a..410544ec47 100644
--- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/convert-json-data-to-html.english.md
+++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/convert-json-data-to-html.english.md
@@ -14,8 +14,9 @@ Then, loop through the JSON, adding HTML to the variable that wraps the key name
Here's the code that does this:
```js
+let html = "";
json.forEach(function(val) {
- var keys = Object.keys(val);
+ const keys = Object.keys(val);
html += "
diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md
index dbf4967f53..f4e9ca9f19 100644
--- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md
+++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md
@@ -16,12 +16,12 @@ However, JSON transmitted by APIs are sent as bytes, and your appli
You can request the JSON from freeCodeCamp's Cat Photo API. Here's the code you can put in your click event to do this:
```js
-req=new XMLHttpRequest();
+const req = new XMLHttpRequest();
req.open("GET",'/json/cats.json',true);
req.send();
-req.onload=function(){
- json=JSON.parse(req.responseText);
- document.getElementsByClassName('message')[0].innerHTML=JSON.stringify(json);
+req.onload = function(){
+ const json = JSON.parse(req.responseText);
+ document.getElementsByClassName('message')[0].innerHTML = JSON.stringify(json);
};
```
@@ -64,8 +64,8 @@ tests:
```html
+
+
Cat Photo Finder
The message will go here
@@ -119,11 +121,11 @@ tests:
## Solution
-```js
+```html
// solution required
+
+
Cat Photo Finder
The message will go here
diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.english.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.english.md
index cb1181b171..3aa05de169 100644
--- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.english.md
+++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/handle-click-events-with-javascript-using-the-onclick-property.english.md
@@ -10,7 +10,7 @@ forumTopicId: 301503
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:
```js
-document.addEventListener('DOMContentLoaded',function() {
+document.addEventListener('DOMContentLoaded', function() {
});
```
@@ -18,7 +18,7 @@ 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:
```js
-document.getElementById('getMessage').onclick=function(){};
+document.getElementById('getMessage').onclick = function(){};
```
@@ -49,13 +49,14 @@ tests:
```html
+
+
Cat Friends
Reply from Server will be here
@@ -126,7 +128,68 @@ tests:
```js
-// solution required
+
+
+
+
+