这是我的代码。我需要在外部函数中访问内部函数变量
var json = {}, state, response;
readRequestValues();
var xhr = new XMLHttpRequest();
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange=function(){
if(xhr.readyState == 4){
json.state = xhr.readyState;
json.response = xhr.responseText;
log.info(">>>>>>>>>>>>>>>"+json.state+">>>>>"+json.response);
var retValue=JSON.stringify(json);
log.info(">>> THIS IS RESULT >>>"+retValue);
}
}
xhr.open("GET", strBackend, true);//async=true
xhr.send();
log.info(">>> HERE I NEED TO ACCESS retValue >>>"+retValue);
谢谢