I am trying to make a HTML5 app and i need to dynamically change the content of a div with different html files depending on the menu select. The code I currently have loads the menu however when I click on a button I receive a short message "Error loading page" that disappears after a few seconds. I've fiddled around with it myself and can't quite figure out what is going wrong so I'll show the code I currently have.
index.html -
<body>
<div data-role="page" id="index">
<div id="wrapper">
<div data-role="controlgroup" data-corners="false" data-position="left">
<a href="/html/home.html" id="home" data-role="button">HOME</a>
<a href="/html/tracking.html" id="track" data-role="button">TRACKING</a>
<a href="/html/favourites.html" id="fav" data-role="button">FAVOURITES</a>
<a href="/html/setting.html" id="set" data-role="button">SETTINGS</a>
<a href="/html/login.html" id="login" data-role="button">LOG IN</a>
</div>
<div id="main">
<div id="header" data-role="header" data-theme="b">
<a id="bars-button" data-icon="bars" class="ui-btn-right" style="margin-top:0px;" href="#navpanel">MENU</a>
</div>
<div id="dMain"> </div>
</div>
</div>
</div>
<script>
//$(document).ready(function(){
//$('#home').click(function(){
// $('#dMain').load('/html/home.html');
// });
//});
</script>
</body>
home.html -
<body>
<div data-role="page" id="home">
<h1>Hello</h1>
<h2>This is the home page</h2>
<p>it will contain about us information</p>
</div>
</body>
I have changed bits and pieces so it is not in a working state currently but any suggestions on how to fix/improve this code would be greatly appreciated.