Ajax error null return value

Asked

Viewed 164 times

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.

  • 1

    In the console, when the request is made, which error returns?

  • 1

    what’s the mistake??

  • This is the problem presents the error 404, already put to detail the error, but does not present anything. It goes straight to "error:"

  • your server must be without external access... review its settings and change the 127.0.0.1 to 0.0.0.0.0

  • He’s got outside access.

  • use a browser plugin for REST requests for more details of the problem

  • That controller Consulta by chance is not under a Area in your MVC project ?? And also, if the action FiltraLevatamento wait some parameter and these parameters are different the route is not effective.

  • If error 404 is that it did not find, you can access ajax via browser?

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.