ajax

var rsCode = null; if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { rsCode = xmlHttp.responseText; if (rsCode == "1000") { alert("成功删除!"); initSelectedFileCode(); selectFile(selectedFileCode); } else { alert("删除失败!"); } } else { alert("服务器连接异常!"); } } **************************************** function initSelectedFileCode() { var radioValues = document.getElementsByName("radiobutton"); for(var i = 0 ; i < radioValues.length ; i++) { if(radioValues[i].checked) { selectedFileCode = radioValues[i].value; break; } } } ********************************************** function selectFile(fileCode) { createXMLHttpRequest(); var contractDocId = ''; var queryType = ''; var theurl = "<%=request.getContextPath()%>/ContractDocMrgAction.do?operation=ajaxQueryDetail&contractDocId=" + contractDocId + "&fileCode="+fileCode +"&queryType=" + queryType; xmlHttp.open("GET", theurl, true); xmlHttp.onreadystatechange = callback; xmlHttp.send(null); } ********************************************************* function callback() { var tbody20 = document.getElementById("Table20"); if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { tbody20.innerHTML = xmlHttp.responseText; } else { tbody20.innerHTML = '
装载数据失败,原因:"+xmlHttp.statusText +"
'; } } else { tbody20.innerHTML = '
正在装载数据,请稍候...
'; } }

你可能感兴趣的:(Ajax)