这是我的Ajax函数的一部分。出于某种原因,我无法弄清楚,我能够alert() responseText但不能返回 responseText。任何人都可以帮忙吗?我需要该值用于其他功能。为什么我不能从Ajax函数返回responseText?
http.onreadystatechange = function(){
if(http.readyState == 4 && http.status == 200){
return http.responseText;
}
}
参见[ 如何从函数调用函数返回变量onreadystatechange = function() ](http://stackoverflow.com/questions/1955248/how-to-return-variable-from-the-function-called -by-onreadystatechangefunction)和[AJAX]如何从onreadystatechange = function()函数()返回变量(http://stackoverflow.com/questions/290214/in-ajax-how-to-retrive-variable-from - 内 - 的-的onreadystatechange函数)。 – 2010-09-17 02:23:58