jjacquay712
Programmer
- Dec 12, 2008
- 1
I have a javascript function that is supposed to return a number from a php script, but when i call the function, its value is undefined. here is the function:
(function to get xmlhttp variable not shown)
function latestid() {
xmlHttp.onreadystatechange=function(){
if( xmlHttp.readyState == 4 ) {
return xmlHttp.responseText;
}
}
xmlHttp.open("get",'ajax/latestid.php',true);
xmlHttp.send(null);
}
is there any problems you see in my code? or suggestions on why it isnt working? thanks, John Jacquay
(function to get xmlhttp variable not shown)
function latestid() {
xmlHttp.onreadystatechange=function(){
if( xmlHttp.readyState == 4 ) {
return xmlHttp.responseText;
}
}
xmlHttp.open("get",'ajax/latestid.php',true);
xmlHttp.send(null);
}
is there any problems you see in my code? or suggestions on why it isnt working? thanks, John Jacquay