I have tried window.history.pushState('', '', site_url + '' + ActivityUrl); and also window.history.replaceState('', '', site_url + '' + ActivityUrl);
I need to update the URL in the browser without redirecting to it. All the solutions I had got are the above two, but this is not working and also not displaying any errors.
The code I'm using is in an AngularJS controller,
$scope.updateUrl = function (ActivityUrl) {
window.history.pushState('', '', site_url + '' + ActivityUrl);
}
and calling this function with a ng-click.