0
i have genrate a confirm message for session extend and it work properly. but i want that if user not respond to it than it will automatically hide.i have write following code .
if($("#takephotopageload").length > 0) {
        setInterval(function(){
          $.ajax({
            url: "check_session.php",
            //data: {action: 'clickme_clicked'},
            dataType: "json",
            success: function(data) {
              if(data.time > idletimeout) {
                var answer = confirm("Your session has expired. Would you like to extend it?");
                setInterval(function () { window.confirm.dialog("close"); }, 3000);
                if(answer == true) {
                  $.ajax({
                    url: "reactivate_session.php",
                    dataType: "json",
                    success: function() {},
                  });
                } else {
                  window.location.reload(true);
                }
              }
            }
          });
        },3000);
      }
3
Contributors
5
Replies
20
Views
3 Years
Discussion Span
Last Post by diafol
0

i have use this line of code for hide confirmation dialoge box setInterval(function () { window.confirm.dialog("close"); }, 3000);
but it not work.please give me some nedd ful suggestion

0

yes it is php related.in my case i have genrate a confirm window for user who is idle more than 1 minute by showing confirm window using
var answer = confirm("Your session has expired. Would you like to extend it?");
but i want to hide this confirm window within 10 second if user does not respond it.

0

Not sure how you'd use php to close a js confirm. I'd suggest that you use a js solution. Possibly using a custom modal dialog (e.g. jQueryUI) coupled to a timer. Grabbing control of a browser's modals sounds difficult - not sure if this is possible - it would probably be a security risk if it were.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.