function getsysinfo() {
......
xmlhttp.open("post","/page/user/ShowMachine.jsp",true);
xmlhttp.send(null);
alert("注册成功");
...<form action="saveMachineInfo.do" >
....
<input type="submit" name="button" value="注册" onclick="getsysinfo()" />
我想弹出 alert窗口后,返回/ShowMachine.jsp 咋不可以?
返回的是http://localhost:7001/saveMachineInfo.do?usernameo=wwwwww&userunit=wwwwww&username=ceshi&macIp=undefined&ip=undefined&harddiskId=undefined&cpuId=undefined&status=1&button=%E6%B3%A8%E5%86%8C
......
xmlhttp.open("post","/page/user/ShowMachine.jsp",true);
xmlhttp.send(null);
alert("注册成功");
...<form action="saveMachineInfo.do" >
....
<input type="submit" name="button" value="注册" onclick="getsysinfo()" />
我想弹出 alert窗口后,返回/ShowMachine.jsp 咋不可以?
返回的是http://localhost:7001/saveMachineInfo.do?usernameo=wwwwww&userunit=wwwwww&username=ceshi&macIp=undefined&ip=undefined&harddiskId=undefined&cpuId=undefined&status=1&button=%E6%B3%A8%E5%86%8C
xmlhttp.open("post","/page/user/ShowMachine.jsp",true);
xmlhttp.send(null); 点注册后,弹出窗口后,再返回到原来的页面??哪里错了
你这不是ajax吗~·当前页面不会变啊~·
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript"> function getsysinfo() {
createXmlHttpRequest(); //创建XmlHttpRequest对象,楼主可以自己设置,就不写了
var url="/page/user/ShowMachine.jsp"+"×tamp="+new Date().getTime();
xmlhttp.open("GET",url,true);
//设置回调函数
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4&&xmlhttp.status==200)
{
alert("注册成功");
window.location.href="/page/user/ShowMachine.jsp";
}
}
xmlhttp.send(null);
}
</script>
</head><body>
<form >
....
<input type="submit" name="button" value="注册" onclick="getsysinfo()" />
</form>
</body>
</html>