To redirect current page I use window.document.location() statement inside the ajax() function. But it is showing error(in firebug). There is no error in functionality request is going and response is comming properly. window.document.location('user/index.php'); statement creating the problem. How can I redirect this page to another if the msg=='YES'?
$.ajax({
url: "user_registration.php",
type: "post",
data: datastring,
success: function(msg) {
if(msg=='YES') {
window.document.location('user/index.php');
}
else
$("#success").html(msg);
}
});