AJAX get problem with varible
Hello,
I would like to ask you how to get the value of variable "data".
This not working:
- ...
- else if (field == 'username')
{
$.get("register.php", {check: content1},
function(data)
{
if (data == 'ok') {ok = 1;} else {ok = 2;}
});
}
- ...
And this working, but I don't want any alert.
- ...
- else if (field == 'username')
{
$.get("register.php", {check: content1},
function(data)
{
if (data == 'ok') {ok = 1;} else {ok = 2;}
});
alert('');
}
- ...
Thank you very much for your help!