I want to reload my page after successful login i.e. whether $.post() returns a 1 page should reload and for a 0 it shouldn't.
For example, my initial attempt:
var logon = false;
$('#formname').submit(function() {
$.post('load.php', $('#formname').serialize(), function(data) {
if(data == '0')
logon = false;
else
logon = true;
});
return logon;
});
How can I do this?