How can I create a link that redirects to another page without any visible effect on the current page? I have tried various methods:
<a href="url">
<a href="url" target="_self">
<a ng-click="register()">
The "register" function is a controller function, and I have attempted the following within the function body:
$window.location.href(url)
$window.location.href = url
$window.location = url
After each method, I also used $window.location.reload()
, which did not cause any change in the URL or refresh the page. Despite seeing these methods recommended as solutions by others, none of them worked for me. My project is using Angular 1.2, an older version.
EDIT: Apologies for any confusion caused by lack of specificity. The term "url" is simply being used as a placeholder for a generic inline string, and all HTML elements are properly closed. I listed multiple methods quickly based on examples from other sources, but unfortunately, none have proven successful. Additionally, my application is set to html5mode with $location.