How to redirecting to a new page after closing popup window with code like this:
send_ajax_formdata("POST","{{ url('/url') }}", {}, fData, {})
.then((resp) => {
if(resp[0].valid == "true") {
success_alert(resp[0].message);
}else {
warning_alert(resp[0].message);
}
elem.removeClass("disabled");
elem.html(text);
})
.catch((err) => {
danger_alert(err.message);
elem.removeClass("disabled");
elem.html(text);
})
When button close clicked then it will close the popup window with script disabled removeClass. But instead back to page where that popup window page exist, I want to redirecting it to a new page. How to do that?
2
Answers
you use window location to redirect to url in jquery.
Here, resp.data.redirect_path is your redirect url variable, you can also use solid url to any page like:
You can use location.replace