After receiving the result from the ajax success method, I am facing an issue where the redirection to another page is being blocked and displaying the following error:
Page 405 Method Not Allowed
I am seeking suggestions on how to fix this as I need to successfully redirect to the desired page.
This is what I have attempted so far:
function callinsert(db, tbl, pk, jobj) {
$.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Bearer " + at);
},
url: "MYURL/Insert?database=" + db + "&tablename=" + tbl + "&pk=" + pk,
contentType: 'application/json',
data: jobj,
dataType: "json",
async: false,
type: "POST",
success: OnSuccessInsertEmployee,
/*Create a Function to run the Success Action */
error: errorAction
});
}
function OnSuccessInsertEmployee(data) {
//In this part of the code, I want to redirect to another page
location.href = "xxxx.html";
}