Total beginner with javascript and ajax. I wasted two days could not figure this out...
I've processor.php which contains: echo json_encode('ok');
My ajax submits form to that file and receives response ok.
Now I want to use that ok inside my function:
success: function (data) {
if (data == "ok") {
//do smth
}
Unfortunately this if never evaluates true.
I check alert(data); inside success function and I get "ok"
What is the problem here?