<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<script language="javascript">
function windowopen(){
document.all.form1.submit;
newwindow=window.open("","target","scrollbars")
if (document.all){
newwindow.moveTo(0,0)
newwindow.resizeTo((screen.width-300),(screen.height-300))
}
}
</script><form name="form1" method="post" action='execexe.htm' onsubmit='windowopen()' target=target>
<input type="text" name="aa">
<input type='submit'>
</form></body>
</html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<script language="javascript">
function windowopen(){
document.all.form1.submit;
newwindow=window.open("","target","scrollbars")
if (document.all){
newwindow.moveTo(0,0)
newwindow.resizeTo((screen.width-300),(screen.height-300))
}
}
</script><form name="form1" method="post" action='execexe.htm' onsubmit='windowopen()' target=target>
<input type="text" name="aa">
<input type='submit'>
</form></body>
</html>
Form.target=WindowName
Form.Submit这样就把数据提交到一个新的页面乐~~~~~~
window.open()方法能实现这样的功能吗?billyqiao(如冰)描述的情况好像与我的问题比较接近,您能贴个例子来看看吗?
或者指点一下我现在的处理方式的问题在哪?谢谢了
文件名:login_do.asp
<html>
<head><title>有提示页面的刷新顺序</title></head>
<% '如果提示框出现在这个位置,后背景就是空白%>
<script language="javascript">
alert("这里的提示框后背景是白的")
</script>
<body bgcolor="#2857ad">
<form name="myform" method="post" action="login_do.asp">
<table border=1 bordercolor="ffffff" align="center" width="80%">
<tr>
<td align="center" height="25">
测试名称 <input type="text" name="name" value="姓名测试">
</td>
<td align="center">
<input type="submit" name="subbutton" value="提交测试">
</td>
</tr>
</table>
</form>
</body>
<% '如果提示框出现在这个位置,后背景就不是空白%>
<script language="javascript">
alert("这里的提示框后背景不是白的")
</script></html>
我需要实现的功能是,
用户点击页面的提交按钮,请求提交到Servlet后进行数据库访问,最后Servlet以模式弹出对话框的形式将访问结果反馈给用户。
我想如果把数据库访问的代码写在SCRIPT里,如下所示
function mySubmit(){
....//访问数据库;
window.showModalDialog('访问结果.jsp','访问结果参数')
}
可能能实现我所期望的功能。但是我如何把数据库访问的代码挪到Servlet中,还能实现上述功能呢