您可以更改
location.hash属性,它会更改当前的锚标识符,而无需导航离开页面,例如,您可以:
<a href="http://mysite.com/cats" id="cats" >Cats</a><a href="http://mysite.com/dogs" id="dogs" >Dogs</a>
然后:
$('.ajaxlink').click(function (e) { location.hash = this.id; // get the clicked link id e.preventDefault(); // cancel navigation // get content with Ajax...});


