I'm using AJAX to fetch JSON data. The user fills out a form with some addresses, and these addresses are posted using AJAX. The response will either be "status": "fail"
, "status": "unknown"
or "status": "success"
+ a lot of other stuff based on the status. Each status should cause a new page to load with the rest of the response.
My issue is getting the data to the new page.
$.ajax({
url:"https://domain.local/",
type:"POST",
crossDomain: true,
dataType: "json",
data : data,
headers: {
'Content-Type': "application/json; charset=utf-8"
},
success: function(data) {
if (data.result.Status == " fail ") {
// head to fail.php and show response
}
else if (data.result.Status == " unknown ") {
// head to unknown.php and show response
}
else if (data.result.Status == " success ") {
// head to succes.php and show response
}
}
});
Does anyone know how to do that?