D
D
Denis Bukreev2016-10-10 19:57:35
JavaScript
Denis Bukreev, 2016-10-10 19:57:35

How to change the address bar on actions on the page?

So it goes.
There was an unexpected task - through a link so that you can open a modal window.
Accordingly, when the window is opened, this link should be generated in the address bar.
How to implement it correctly?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Deodatuss, 2016-10-10
@Deodatuss

add a hash to the link, for example #open-modal, and check
window.location.hash === '#open-modal' on load

A
Alexander Aksentiev, 2016-10-10
@Sanasol

History API

D
Denis Ineshin, 2016-10-10
@IonDen

History.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question