How to Change Browser URL without reloading refreshing page using HTML5 in JavaScript and JQuery
Answer (1)
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.");
}
}
ChangeUrl('Page1', ''loading.php');
how to get #variable or any variable from url in javascript
By : Deepak Sharma | 05-11-2019 | 45 Likes
if url is www.example.com#home1 var hash = window.location.hash.substr(1); alert(hash);
By : Ankur Rajput | 05-11-2019 | 45 Likes