简体   繁体   中英

Preventing modal window when the page is refreshing

I have a modal window (bootstrap 4) with on load function on my web page. Also I have a multipage gridview. When I open my web page modal window shows and there is no problem. But, when I click next page on gridview, page refreshes and modal window shows again. How to prevent showing modal window second time. Thanks in advance.

<script type="text/javascript">
$(window).on('load',function(){
    $('#myModal').modal('show');
});

$(window).on('load',function(){
     if(!sessionStorage.hasOwnProperty("isPopuped")){
        $('#myModal').modal('show');
        sessionStorage.setItem("isPopuped",true);
      }
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM