


| function freshId(){ | |
| var xmlHttp; | |
| if (window.ActiveXObject) { | |
| xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
| } else if (window.XMLHttpRequest) { | |
| xmlHttp = new XMLHttpRequest(); | |
| } else { | |
| alert("请更换浏览器!"); | |
| return; | |
| } | |
| xmlHttp.open("GET", "getcode.jsp", true); | |
| xmlHttp.onreadystatechange = function () { | |
| if(xmlHttp.readyState == 4 && xmlHttp.status == 200) { | |
| var data=JSON.parse(xmlHttp.responseText); | |
| var strSrc = 'data:image/png;base64,' +data.vda; | |
| document.getElementById("codeId").value=data.vid; | |
| document.getElementById("imgGv").src=strSrc; | |
| } | |
| }; | |
| xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); | |
| xmlHttp.send("{\"vty\":\"vtext\"}"); | |
|
} 我要写一个模拟登录的,但是传递参数的时候卡在了codeID的这个地方,传送HTTP请求的时候回发送codeID过去,请问一下,使用JAVA要怎么样获取到这个codeID |