I have a webpage called index.html that is connected to other pages (portfolio.php, friendzone.php and so on) through jQuery load() method.
Example: my menu has the following code:
<a href="./" class="button"><div id="homepageBtn"></div></a>
<a onclick="showPage('progressi')" class="button"><div id="progressiBtn"></div></a>
<a onclick="showPage('interessi')" class="button"><div id="interessiBtn"></div></a>
<a onclick="showPage('friendzone')" class="button"><div id="friendzoneBtn"></div></a>
<a onclick="showPage('contact')" class="button"><div id="emailBtn"></div></a>
When I click something that is not the homepage option, the showPage() function is called:
function showPage(page) {
$("#post-title").fadeOut (200, function() {
$("#post-title").html(page); // Edit the page title in the div
Cufon.refresh(); // I use Cufon plugin, so I reload it
}).fadeIn(500);
$("#post-content").fadeOut (200, function() {
$("#post-content").load(page + ".php", function() { // If I pass for example "contact", it loads me the page contact.php in the "post-content" div
$('a.boxed').colorbox({rel: 'Galleria'}); // I use colorbox jQuery plugin, so I reload it here
$('a.iframe').colorbox({iframe: true, width: "80%", height: "80%"}); // Same here
});
}).fadeIn(500);
}
Everything works flawlessly, except for one thing:
When I load another page content inside my div's, the URL doesn't changes. I believe this is very bad for Google crawlers and for users who want to go on the previous page by clicking the back button of their browser or share a link to a specific page of my website.
Is there any way I can achieve a different URL based on the content I load in my div?