3 ms·
If you are working with an single page app, you can open a modal window and change the href without navigation by calling `history.pushstate`. ``` history.push
by dataviz1000 3y ago
If you are working with an single page app, you can open a modal window and change the href without navigation by calling `history.pushstate`.
```
history.pushState({}, "", "/new-url");
```
Moreover, modals serve one very important UI purpose in that they keep the user's mind in a context.