Okay, so I am creating a Jquery registration page using "dialog".
I am using the "jquery" version of AJAX. It's pretty similar, and the problem I am having can happen to either.
Basically this is how my code is organized:
function go_ajax(formtype){
formvalue = document.getElementById(formtype).value;
$.get("/xatron/check.php?type="+formtype+"&value="+escape(formvalue), function(data) {
// TEST alert(data);
return data;
});
}Data = httpObject.responseText
Thats the same as a "get" script in AJAX. Now, later in my code I have...
if(go_ajax('username') == 0){
// Fail
}else{
// Pass
}
Now, it will come up as "Pass" EVERYTIME because...
go_ajax('username') = undefined.
But when I do the test and do the alert above it presents to me, 0 or 1. x_X
And it alerts AFTER undefined alerts. How would I go about fixing this? :O
Anyone know? (p.s. YES, I know this is jquery BUT ajax is the exact same problem (i've tried both methods).
Thank you,
Matt