JQUERY SET TIMEOUT code example
Example 1: settimeout jquery
setTimeout(function(){ alert("Hello"); }, 3000);
Example 2: settimeout javascript
setTimeout(function(){
console.log("hello");
}, 3000);
Example 3: js settimeout
setTimeout(() => { alert('Hello') }, 1000)
Example 4: add set time out in jquery
$(".submit_wide").click(function () {
$(this).val('Please wait..');
$(this).attr('disabled', true);
setTimeout(function() {
$(this).attr('disabled', false);
$(this).val('Submit');
}, 2000);
});
Example 5: php expire a session
$minutesBeforeSessionExpire=30;
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > ($minutesBeforeSessionExpire*60))) {
session_unset();
session_destroy();
}
$_SESSION['LAST_ACTIVITY'] = time();
Example 6: settimout jquery
setTimeout(function(){ alert("Hello"); }, 3000);