I need help setting page1.html to display by default when the page loads. Can you provide some guidance?
Appreciate your assistance in advance.
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function swapContent(targetID, url) {
var target = document.getElementById(targetID);
var ajax = new XMLHttpRequest();
ajax.open('GET', url, true);
ajax.onreadystatechange = function() {
if(ajax.readyState == 4) {
target.innerHTML = ajax.responseText;
}
}
ajax.send(null);
}
</script>
</head>
<body>
<div>
<div>
<a href="javascript: void();" onclick="swapContent('searchDiv', 'page1.html');">First</a> |
<a href="javascript: void();" onclick="swapContent('searchDiv', 'page2.html');">Second</a> |
<a href="javascript: void();" onclick="swapContent('searchDiv', 'page3.html');">Third</a>
</div>
<hr>
<div id="searchDiv" style="width: 550px; height: 400px; overflow: scroll;">Please select one...</div>
</div>
</body>
</html>