To change url, you can use something like this:
window.history.pushState("object or string", "Title", "/new-url");
See this link for more information: Updating the address bar with a new URL without a hash or reloading the page
If you want to load some content into the DOM using AJAX (which allows you to do image fading, etc.), you would do something like this:
$('.ajax_content').load(
$(this).attr('href') + ' #someDiv',
function() {
}
);
.ajax_content there will be a div into which you load the content.
Note: This + ' #someDiv'is optional. It allows you to load only a specific div in the Url that you load (so that you can no longer load the whole body into your DOM.
More information about .load()can be found here: https://api.jquery.com/load/
source
share