0
I’m having some difficulty with the following Jquery code:
JQUERY
$(document).ready(function(){
$('#modalLogout').click(function(){
$('#yes').click(function(){
function time()
{
$(location).attr('href',"destroy.php");
}
/*set 1s after ckick in yes, after that redirect to index*/
setTimeout(function(){time()},1000);
/*table fadeout effect*/
$(".row").hide("slow");
});
});
});
What happens is that when opening a modal confirmation window if you are sure you want to continue or end the session, when I click YES it does nothing the first time, I have to open the window again and click YES for the time() function to be executed. But when I click on NO it works correctly, that is, it closes the window and stays in the login. How could I change this strange behavior and improve the code?
Solved the problem, now the behavior is correct!
– Luis