$(document).ready(function(){
$('#getContent').click(function(){
$.ajax({
url: url,
type: post,
cache: false,
beforeSend: function() {
$('#divContent').html('Получаем контент');
},
success: function(html){
$("#divContent").html(html);
}
});
return false;
});
});
<ul id="demo" class="ajaxmenu">
<li><a href="page1.php">Page 1</a></li>
<li><a href="page2.php">Page2</a></li>
<li><a href="page3.php">Page3</a></li>
<li><a href="page4.php">Page4</a></li>
</ul>
<div id="divContent"></div>
<script type="text/javascript">
$(document).ready(function(){
if(window.location.hash) {
var hash = window.location.hash;
var page = $(hash).attr('href');
$("#content").load(page);
}
$('a[id*=page]').click(function(event){
var href = $(this).attr('href');
var hash = $(this).attr('id');
$.ajax({
url: href,
success: function(data){
$("#content").html(data);
window.location.hash = hash;
}
});
event.stopPropagation();
return false;
});
});
</script>
<ul>
<li><a id="page1" href="page1.php">Page 1</a></li>
<li><a id="page2" href="page2.php">Page 2</a></li>
<li><a id="page3" href="page3.php">Page 3</a></li>
<li><a id="page4" href="page4.php">Page 4</a></li>
</ul>
<div id="content"></div>