简体   繁体   中英

location.reload(true) Checking user click

I am calling location.reload(true) from javascript on button click it display the alert message , i want to hide the page when user click the button. The page will appear again when page refresh is completed or user select cancel .

How to check user clicks on cancel/resend/continue?

Are you trying to get the user to answer a yes/no question? If so you need to use confirm() instead of alert() and check the return value. Yes/ok = true, no/cancel = false.

I Think ultimately what you're trying to ask is how to check whether the user has clicked on you Cancel button.

If so, you must be new to jquery.
you'd do this:

     <script>
       $(window).load(function(){
          location.reload(true);
       });

       $(document).ready(function(){
         $("#cancelButtonID").click(function(){
            //this code executes when your cancel button is clicked
             location.reload(true);
         });
       });
     </script>

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