On clicking submit button , it hits my API and returns a json , which i'm able to post it in same page. But I need the results to get posted under div of another html page. I've a problem with ajax success redirect
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: "/upload",
data: data,
success: function (data) {
$("#result").text(data);
console.log("SUCCESS : ", data);
$("#btnSubmit").prop("disabled", false);
}
This is the code. '/upload' is the API url. on success I need the ajax function to redirect to a page say "sample.html" and post the data variable using a div tag. I'm unable to redirect using window.location.href.
Thanks