I have this bit of code on a loading screen which waits five seconds before logging the user in:
setTimeout(
function() {
$.doPost("http://mysite.com", {
username: results.rows.item(0).username,
password: results.rows.item(0).password
});
}, 5000);
While the page is waiting, I also have a button on the screen that says 'Log out' and if clicked, need this post to not happen. Basically, the user has five seconds to hit logout before automatically being logged in. The Log out button has an onClick
and no matter what I put in that function, it continues with the login, how can I have that button stop the $.doPost
from happening?