This might be a simple answer, but I am having some issues writing this little load script… I think I have abug somewhere, I can get it to clear the div, however the page is not loading:
Jquery:
$(document).ready(function() {
//Load content
$(".load").click(function(){
$("#content").empty();
loadName = $(this).find("a").attr("id");
$("#content").load("/content/" + loadName + ".php");
});
});
HTML:
<div id="select">
<div id="menu">
<ul>
<li><a class="load" href="javascript:void(0)" id="project1">Project 1</a></li>
<li><a class="load" href="javascript:void(0)" id="project2">Project 2</a></li>
</ul>
</div>
</div>
<div id="content"></div>
both the php files are located at a link like so (note these are just dummy names and not actual links):
http://www.hostname.com/content/project1.php
http://www.hostname.com/content/project2.php