Is it possible to link to a div without changing the URL (in HTML)? -
So, basically, I want people to navigate their website through a link to the divis, but to change the browser Stop the current URL (this adds #divname to the end of the .html file).
I have something like this:
& lt; Div id = "modallogin" class = "modalLogin" & gt; & Lt ;! - Random stuff here - & gt; & Lt; / Div & gt; And somewhere else I have a link to that div:
& lt; A href = "# modalLogin" & gt; & Lt; Img class = "btnlogin" src = "../ images / btnLogin.png" alt = "Sign in!" / & Gt; & Lt; / A & gt; But, as I mentioned earlier, whenever they click on those types of links, the URL changes. I would like to be able to navigate the website without that incident. If possible, just by using HTML (no javascript, no jQuery, no AJAX)
When we are on it, I have not changed the URL of the entire website at all (even when I 've found out the requests and through the different files clearly ), And some do not show you the 'expected address' (url at the bottom of the browser). How can I do this?
Thanks in advance!
PS: I have searched this website, and apparently ask about all the 'same' questions on the contrary: URL
I think you can use javascript for this .. < Pre> & lt; Script & gt; // your current URL var url = window Get location. String (); Remove the anchor from the URL using // split url = url.split (â ???? # â ????) [0]; & Lt; / Script & gt; sample
Comments
Post a Comment