JQuery Messages Stopped Working

I have a web application that I wrote using jQuery. I used the $ .post methods throughout the application, including the login screen. It worked perfectly and now all of a sudden unexpectedly, it no longer works. However, the response to the message now returns null; if I manually print the message, it will return the JSON code that I would expect.

A few things that might be useful: 1.) I am contacting jQuery hosting. 2.) I have not made any changes to my code or site. It worked fine about a week before this morning. 3.) Sometimes a jquery post query works. Especially when I slowly go through the code.

Here is a piece of code that does not work:

function TryLoggingIn()
{
$.post(
    "login.php",
    {action: "login", username: $("#_uxUsername").val(), password: $("#_uxPassword").val(), redirect: $("#_uxRedirect").val()},
    function(data)
    {
        if (data.response == "error")
        {
            $("#_uxErrorBox").slideUp();
            $("#_uxErrorBox").slideDown();
            $("#_uxErrorText").text(data.message);
            $(".widgetErrorIcon").show();
        }
        else
        {
            window.location = data.newlocation;
        }
    },
    "json"
 );

}

, , WireShark, , , null.

+3
1

, , WireShark , - Ajax . - URL .

Firebug , WireShark .

, ajax jQuery.ajax(), jQuery.post(), , -, "", ..

+2

Source: https://habr.com/ru/post/1751227/


All Articles