I have encountered a unique issue not addressed in previous discussions.
When the destination id is on a different page, I am experiencing difficulty removing #url.
My Approach : On two HTML pages - index.html & about.html, I have displayed various menu information by utilizing
<div id="one"></div>
on the index.html page instead of creating separate pages for each menu item. In an attempt to eliminate #url when clicked, I experimented with the following lines individually:
history.pushState('', document.title, window.location.pathname);
var target = $(this.target);
Unfortunately, the #url is only disappearing on the index.html page. When clicking on menu items on the about.html page, the #url remains visible (due to the
<div id=""></div>
being present on index.html). Could anyone assist me in resolving this issue and removing #url even if the destination id is located on a different page?