-
Notifications
You must be signed in to change notification settings - Fork 0
/
Me.js
56 lines (48 loc) · 1.62 KB
/
Me.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//fact file about me
const app = document.getElementById('fact');
const container = document.createElement('div');
container.setAttribute('class', 'container');
app.appendChild(container);
var request = new XMLHttpRequest();
request.open('GET', 'infromation.json', true);
request.onload = function () {
document.getElementById("Border").style.border = "thick solid green";
// Begin accessing JSON data here
var myObj, a;
var myObj, b;
var myObj, c;
var myObj, d;
var myObj, e;
var myObj, f;
var myObj, g;
myObj = {
"full_name":"Divyang Verma",
"Age":"10",
"hobbies":"Science, Math, Piano, playing with Deetya, ...",
"sibilings":"Deetya, age:2",
"school":"brown elementey",
"grade":"4th",
"games":"None",
};
a = myObj.full_name;
b = myObj.Age;
c = myObj.hobbies;
d = myObj.sibilings;
e = myObj.school;
f = myObj.grade;
g = myObj.games;
document.getElementById("about1").innerHTML = "Full name: "+a;
document.getElementById("about2").innerHTML = "Age: "+b;
document.getElementById("about3").innerHTML = "Hobbies: "+c;
document.getElementById("about4").innerHTML = "Sibling: "+d;
document.getElementById("about5").innerHTML = "School: "+e;
document.getElementById("about6").innerHTML = "Grade: "+f;
document.getElementById("about7").innerHTML = "Games: "+g;
// <!-- var aLink = document.createElement('a'); -->
// <!-- var link = document.createTextNode("Corona-API"); -->
// <!-- aLink.appendChild(link); -->
// <!-- aLink.href = "https://corona-api.com/countries/us"; -->
// <!-- card.appendChild(aLink); -->
container.appendChild(card);
}
request.send();