Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modal URL Change

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)

like image 398
James Avatar asked Nov 07 '13 04:11

James


People also ask

Do modals have a URL?

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.

How do I open URL in modal popup?

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.

How do you toggle a modal?

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.

How do I turn off modal dialog?

Click the button to launch the modal. Then click on the backdrop, close icon or close button to close the modal.


1 Answers

You want to take a look at HTML5 pushState(). Check out this article.http://diveintohtml5.info/history.html

like image 124
sp0rkyd0rky Avatar answered Oct 07 '22 21:10

sp0rkyd0rky