May 4, 200917 yr Ok, i've got this (see below ) so far, and it works great, however because i'm using a base url, i'm getting urls like mydomain.com/services/#services/my-service.php Which obviously doesn't look too great, This is what i have $(document).ready(function() { function showNewContent() { $("#dynamic").fadeIn(); $("#load").fadeOut(); } function pageload(hash) { if(hash) { $("#dynamic").load(hash + " #dynamic " ,function(){ if($("img:last",this).get(0)) { $("img:last",this).load(function(){ showNewContent(); }); } else { showNewContent(); } }); } else { $("#dynamic").load("services/index.php #dynamic"); } } $.historyInit(pageload); $("ul.service-nav li a").click(function(){ var hash = $(this).attr("href").substr(0,$(this).attr("href").length,0); $("#dynamic").fadeOut(300,function(){ $.historyLoad(hash); }); if(!$("#load").get(0)) { $("#dynamic").append(\'<img src="images/icons/loading.gif" class="loading-center" />\'); } $("#load").fadeIn("normal"); return false; }); }); Now if i change this var hash = $(this).attr("href").substr(0,$(this).attr("href").length,0); to something like this var hash = $(this).attr("href").substr(0,$(this).attr("href").length-4); I get the desired url, however it effects the request so it can't find the page, my question is how would i go about sending the request and then manipulate the # Anyone know? Or point me in the right direction?
Create an account or sign in to comment