I'm trying to open a Bootstrap Modal while changing the URL displayed in the browser's navigation bar. The user is not actually going to a different page, however when the Modal is open the URL will be different. Facebook does this with their URLS when you open photos, pinterest when you open pins, instagram, etc. What's the trick?
Thanks! (basic skills here)
So if a standalone page is used inside a modal popup it would have a separate url but you can not just put that page's address in browser and get popup because popup is styled using css, you will get to see the page contents.
Use the window open() method to popup a window tab as a modal with a URL. Note: JavaScript already has the ShowModalDialog function but it does not work in all browsers.
To trigger the modal window, you need to use a button or a link. Then include the two data-* attributes: data-toggle="modal" opens the modal window. data-target="#myModal" points to the id of the modal.
Click the button to launch the modal. Then click on the backdrop, close icon or close button to close the modal.
You want to take a look at HTML5 pushState(). Check out this article.http://diveintohtml5.info/history.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With