I want to send login data to api of website, if the statusCode returns 302 then I want to redirect the user to another webpage. But my jquery is not executing and giving me the error of $ajax is not defined. Below is my jquery code.
$("#asd").click(function(){
alert("sas");
$ajax({
url:'url.com',
type: 'POST',
data: ({
Username: $('#inputUserName').val(),
password: $('#inputPassword').val(),
returnURL: 'url.com',
}),
success : function(data, textStatus,jqXHR)
{
window.location.href="myvideo.html"
},
error :function(jqXHR, textStatus, errorThrown)
{
alert("Invalid username and password");
}
});
});
});