-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
84 lines (67 loc) · 1.91 KB
/
index.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Recipes with XML</title>
<link rel="stylesheet" href="recipe.css" />
<script src="" type="text/javascript"></script>
</head>
<body>
<div class="full">
<div class="header">
<h2>Recipes with XML</h2>
</div>
<div id="loading">
<img src="loading-spinning-bubbles.svg" alt="Loading icon" />
<progress id="psource" value="34" max="100"></progress>
<input type="file" name="upload" id="" />
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</div>
<div id="lijst">
<script>
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","recepten.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write("<ul>");
var x=xmlDoc.getElementsByTagName("recept");
console.log(x.length);
for (i=0;i<x.length;i++)
{
console.log('recept nummer: ' + i )
document.write("<li>");
document.write("<h3>");
document.write(x[i].getElementsByTagName("titel")[0].childNodes[0].nodeValue);
document.write("</h3>");
// var b = x[i].getElementsByTagName("ingredienten");
document.write("<ul>");
var b = x[i].getElementsByTagName("ingredient");
for (l=0;l < b.length;l++) {
document.write("<li>");
document.write(b[l].childNodes[0].nodeValue);
document.write("</li>");
}
document.write("</ul>");
document.write("<p>");
document.write(x[i].getElementsByTagName("bereidingswijze")[0].childNodes[0].nodeValue);
document.write("</p>");
document.write("</li>");
}
document.write("</ul>");
</script>
</div>
</div>
</body>
</html>