I have a web application that I wrote using JQuery. I used the $.post methods throughout the application including the login screen. It was working fine and now suddenly out of the blue, it no longer works. The post response now returns null, however; if I manually type in the post, it returns the JSON code that I would expect.
A few things that might be helpful: 1.) I'm linking against the Google's hosting of JQuery. 2.) I have not made any changes to my code or site. It was working fine for about a week before this morning. 3.) Occasionally, the jquery post request does work. Especially when I'm slowly stepping through the code.
Here's a snippit of the code that's failing:
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"
);
}
What's strange is that when it does fail and I'm watching it using WireShark, I never see the post request made, yet it enters the success function with data set to null.