I type my first code with ajax but it doesn't.Please help. It must be change the section content with inside of menu.txt when I click the menu button.But it doesn't work.
this is my html code:
<li id="navMenuButton">
<a href="#" onclick="$menu.txt.loadDoc();">
<span class="glyphicon glyphicon-cutlery"></span><br class="hidden-xs"> Menu</a>
</li>
<section id="homepage">
<div id="main-content" class="container">
<div class="jumbotron">
</div>
<div class="row">
.
.
.
and this is my js code:
$(document).ready(function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("#homepage").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "menu.txt", true);
xhttp.send();
});