-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.htm
58 lines (52 loc) · 1.34 KB
/
main.htm
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
<html>
<head>
<link rel="stylesheet" type="text/css" href="defaultdark.css" />
<script type="text/javascript">
function loadXMLDoc(sectionName)
{
var sectionFile = sectionName + ".txt"
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("bodysection").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",sectionFile,true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="wrapper">
<h1>Rob Davies Photography</h1>
<hr />
<div id="nav">
<ul>
<li onclick="loadXMLDoc('welcome')">HOME</li>
<li onclick="loadXMLDoc('about')">ABOUT</li>
<li onclick="loadXMLDoc('gallery')">GALLERY</li>
<li onclick="loadXMLDoc('contact')">CONTACT</li>
</ul>
</div>
<div id="bodysection">
</div>
<div id="footer">
Copyright 2011 Rob Davies
</div>
</div>
</body>
<script type="text/javascript">
sectiondata = loadXMLDoc("welcome");
document.getElementById("welcome").innerHTML=sectiondata.responsetext;
</script>
</html>