1
I have a function in ajax:
$.ajax({
type: "POST",
url: "@Url.Action("FiltraLevatamento", "Consulta")",
data: JSON.stringify(jsn),
contentType: "application/json",
dataType: "json",
async: true,
success: function (data) {
result(data);
$("#modalboxProcessa").modal("hide");
},
error: function (XMLHttpRequest, txtStatus, errorThrown) {
$("#modalboxProcessa").modal("hide");
$("#modalboxErro2").modal("show");
}
});
On my local machine works correctly, only when I publish on the server the error in ajax.
Can anyone tell me what the problem is? I have practically the same ajax only it returns me other different data, and it works normally.
In the console, when the request is made, which error returns?
– henriquedpereira
what’s the mistake??
– CesarMiguel
This is the problem presents the error 404, already put to detail the error, but does not present anything. It goes straight to "error:"
– rysahara
your server must be without external access... review its settings and change the 127.0.0.1 to 0.0.0.0.0
– Pedro Laini
He’s got outside access.
– rysahara
use a browser plugin for REST requests for more details of the problem
– Pedro Laini
That controller
Consulta
by chance is not under a Area in your MVC project ?? And also, if the actionFiltraLevatamento
wait some parameter and these parameters are different the route is not effective.– DontVoteMeDown
If error 404 is that it did not find, you can access ajax via browser?
– PauloHDSousa