Trying to change the URL using window.location.href doesn't seem to be working for a specific link.
The current page URL is:
http://localhost:37368/Office/Search/c2VhcmNoaWRzPTEyMiwxMjIsMTI0LDE1OCwzNzl8bG9jYXRpb25pZHM9MSwyfGZyb21pZHM9fHRvaWRzPQ==
After clicking a button and triggering an AJAX post, the JavaScript code changes the URL to http://localhost:37368/Office/
Despite this change, the page keeps redirecting back to the initial URL.
Snippet of the JavaScript code:
onClear: function (event) {
//.... omitted part
var $controller = (event.data.object.settings.controller === undefined) ? '' : event.data.object.settings.controller
$new_url = window.location.protocol + '//' + window.location.host + '/' + $controller;
window.sessionStorage.clear();
window.location.href = $new_url;
}