This ajax code posts the variables and displays $('#data').html(data);
which is been eco-ed
in php
.-which works
$.post('login.php',{username:username,password:password},
function(data)
{
$('#data').html(data);
if (data=='login'){
alert("sucess");
}
});
However the problem lies on the next line which does not work:
if (data == 'login') {
alert("sucess");
}
This code is supposed to show a dialog box if the data == login
I have looked through different tutorials and this code is supposed to be working but its doesn't for some reason.
Thanks!