I'm using the History API's replaceState() when a Bootstrap modal is displayed, so the user can share, bookmark, etc. the URL when the page is in it's current state. When a user closes the modal, the URL still contains the query string domain.com/page/?modal=url-friendly-name
.
I cannot seem to get the URL to return to just domain.com/page/
. How can this be accomplished?
I believe whatever code is needed, should be inserted in the following event listener:
$('#modal').on('hidden.bs.modal', function () {
// return URL back to domain.com/page/
});
Any help would be greatly appreciated!