This is a stupid simple question, but ive been staring at it all night and can't get it right. I need to change the page on sucess, right now I can only get it to work using .load to load a div from the desired page. I want it to redirect to the entire page.
Here is what I have
success: function(data) {
if (data=="Error") {
$("#error").show();
$("#processing").hide();
} else {
$("#contain").load("fi开发者_运维百科nalPage.php #desiredDiv");
}
}
I just want it to go to that page instead of loading a chunk of it. window.load isn't working
By setting window.location.href
you'll cause the browser to redirect, like this:
success: function(data) {
if (data == "Error") {
$("#error").show();
$("#processing").hide();
} else {
window.location.href = "finalPage.php";
}
}
精彩评论