Add #modal
part to the href
in page2, and check URL on page1 load and if it contains #modal
, show modal.
$(document).ready(function(){
if(window.location.href.indexOf('#modal') > -1)
$('#myModal').modal();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…