Change Url In Address Bar After Click On Dom Element With Javascript/jquery
is there any way to change the URL in browser without reloading page after click a DOM element? $('#filter_form').on('change', function () { $.ajax(options); //
Solution 1:
Yes, this is possible with the history API. Both history.pushState
and history.replaceState
let you specify a new URL, e.g.:
history.pushState(null, null, "filters?type=apartment");
The URL is resolved in the usual way.
Browser support is good, other than IE9 and earlier.
Post a Comment for "Change Url In Address Bar After Click On Dom Element With Javascript/jquery"