Dani
Fri, 02 May 2008 11:25:48 -0700
Good evening, I'm trying to code a logging form, but I have a problem redirecting the user to another page. The problem is that the page I want to redirect to is being loaded in the background, like it was an Ajax call (I've seen it thanks to the Firefox plugin Tamper Data). That's the code I'm using:
$(document).ready(function() {
var options = {
beforeSubmit: ValidateForm,
success: Logging,
dataType: 'json'
};
$('#login').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
});
function Logging(data) {
if(data.login != "true") window.location = "user.html"; //This page
is loaded as an Ajax call and isn't shown
else ShowError("Username or password incorrect");
return false;
}
Hope someone will know how to fix it or a better way to do it. Thank
you very much!
Dani