I am creating one html login form and sending requests to login.php file. Now it's working properly, but when I am printing "Success" it's returning the same as an ajax response, but when I am comparing this response to another string it's not matching.
My code is in ajax:
var str = AjaxRequest.responseText;
//document.getElementById("balance").innerHTML = AjaxRequest.responseText;
if((str).toString() == "Success")
{
window.location.replace("home.php");
}
else
{
alert("Wrong");
}
I am getting same string in response but why are the if condition not matching? Also the line window.location.replace("home.php"); is not working.