How to recall a function with Jquery in this example?

Posted by Immigrant on Stack Overflow See other posts from Stack Overflow or by Immigrant
Published on 2012-08-30T17:00:01Z Indexed on 2012/09/02 9:38 UTC
Read the original article Hit count: 167

Filed under:
|
|

How to recall a function and have the dialog box keep coming back when click 'cancel' button with Jquery in this example? I am sure it is easy but still learning some of the basics here. Thanks

function definitelyClose() {
    window.location = 'http://www.google.com'
};
var autoCloseTimer;
var timeoutObject;
var timePeriod = 5000;
var warnPeriod = 10000;
$(document).ready(function() {
    $('#proba').dialog({
        autoOpen: false
    });
    setTimeout(function() {
        $('#proba').attr('title', 'Warning').text('Sesion will expire').dialog('open');
        $('#proba').dialog({
            buttons: {
                'Cancel': function() {
                    $(this).dialog('close');
                    clearTimeout(autoCloseTimer);
                }
            }
        });
        autoCloseTimer = setTimeout('definitelyClose()', warnPeriod);
    }, timePeriod);
});?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery