I am trying to change page on click of a
(anchor tag) without refreshing page. I am using the following script.
$('.menu-custom-menu li a').click(function(evt){
evt.preventDefault();
var ntext = $(this).attr('href');
ChangeUrl(ntext, ntext);
});
function ChangeUrl(page, url) {
if (typeof (history.pushState) != "undefined") {
var obj = { Page: page, Url: url };
history.pushState(obj, obj.Page, obj.Url);
} else {
alert("Browser does not support HTML5.");
}
}
The above script only change url not fetching page element, I want when I click on a page so whole content should be there, please help me how to do it.