javascript location href not working on jquery ajax post -
i have following issue: make jquery ajax post and, on success, need change location of browser index view. javascript:
$.post(createreleasenotificationurl, notifications_form.serialize(), function (response) { if (response.indexof("error") == 0) { $("#newnotification_createstatus").html(response); } else { window.location.assign('@url.action("index")'); //window.location = window.location; } }) .fail(function () { $("#newnotification_createstatus").html("an error has occured.<br /> please contact system administrator<br /> if problem persists."); });
however, nothing happens !! missing ?
ps: tried using location.href, no avail.
check this:
window.location.href = '@url.action("index", "controllername")';
Comments
Post a Comment