问题描述
- js中回调函数问题,程序进不了回调函数
- 我这段代码的回调函数哪出错,请各位大神指教
function req(){
createRequest();var zipcode=document.getElementById(""zipcode"").value;
var url=""b.jsp?zipcode="" + escape(zipcode);
request.open(""POST""urltrue);
request.onreadystatechage=updatePage;
request.send(null);
}function updatePage(){ if(request.readyState==4){ alert(""readyState is done""); if(request.status==200){ //alert(""service is done""); var response=request.responseText.split(""); document.getElementById(""city"").value=response[0]; document.getElementById(""province"").value=response[1]; } } }
时间: 2024-11-27 11:18:56