There is a bootstrap modal window with id = "myModal", which opens on the main page of the site when you click on the link:

<a href="#myModal" data-toggle="modal">Окно</a> 

How to make (and is it possible at all) a direct link, so that when you go, a modal window will immediately open?

This option does not work:

 <a href="http://mysite.ru/#myModal">Ссылка</a> 

    1 answer 1

    You can add a condition

     if (document.location.href.indexOf('showModal') != -1) { $("#myModal").modal('show'); } 

    And make a link of this type: http://mysite.ru?showModal

    It will check for the presence of showModal in the address bar and if it is there then popup will appear

    • Then you can just write if (document.location.href == ' mysite.ru/#myModal' ), and it will work too. Thank! - humster_spb