遇到一个问题,50分请帮忙 window.open("url?id="+参数变量,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在弹出的窗口中取值:request.getParameter("id"); lci21(流浪少年)说得对,不过在url中要包含那个JSP文件。 给你句个例子吧,从页面1连到2.jsp,在2.jsp中获得1中的值1.jsp程序如下:<html><head><title></title></head><script language="javascript">function winopen(x){ window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}</script><body><%int a[] = {1,2,3,4,5};%><%for (int i=0;i<5;i++){%><a href="javascript:winopen(<%=a[i]%>)">连接<%=i%></a><br><br><%}%></body></html>2.jsp程序如下:<html><head><title></title></head><body><%String b = request.getParameter("id");%>本页是2.jsp,从1.jsp获得的值为:<%=b%></body></html> 您这样是可以的,但是我想获取表单的值呀,即选ABCD,这个值该怎么传?document.form.xxx.value应该怎么写? faint表单的值不是同样的道理吗?呵呵~~~ <input type=button value="投票" onclick="check()">function check(){ document.yourformname.action = newwindow; document.yourformname.target = _blank; document.yourformname.submit();}第二页:String strvalue = request.getParameter("variable");that'all ok? to lci21(流浪少年):好人做到底吧?再给我个例子?它老是提示说"document.vote.dc.value"不是对象的错误。to whd11808(小玉米):这个窗口能定制吗?固定位置和大小 1.jsp:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>New Page 1</title><script language="javascript">function winopen(x){alert(x);window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}</script></head><body><form name="vote" method="POST" onsubmit="return winopen(window.document.vote.R1.value)"> <p><input type="radio" value="1" name="R1"><input type="radio" value="2" name="R1"><input type="radio" value="3" name="R1"><input type="radio" value="4" name="R1"><input type="radio" value="5" checked name="R1"></p> <p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p></form></body></html>2.jsp:同为何得到是undefined呢? 2.jsp不变,1.jsp如下:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><meta name="ProgId" content="FrontPage.Editor.Document"><title>New Page 1</title><script language="javascript"><!--function winopen(){ var x=document.vote.R1.value; for (i=0;i<document.vote.R1.length;i++) { if (document.vote.R1[i].checked==true) { x=document.vote.R1[i].value; break; } } window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=yes");}--></script></head><body>请选择:<br><form name="vote" method="post"> <p> <input type="radio" value="1" name="R1">选项1 <input type="radio" value="2" name="R1">选项2 <input type="radio" value="3" name="R1">选项3 <input type="radio" value="4" name="R1">选项4 <input type="radio" value="5" name="R1" checked>选项5 </p> <p> <input type="button" value="提交" onclick="winopen()"> <input type="reset" value="全部重写" name="B2"></p></form></body></html> Extjs怎样快速画界面!!!! 头疼了,请教各位一个ie兼容性 的问题 jfreechart做折线图能不能根据数据库内容定时增加点啊? tomcat启动问题 怎么样将地址栏中的值赋给文本框 struts2的问题(急!在线等!!!) 关于radio的问题 今天用了ext做一个分页,始终不显示数据。 高分求助,jsp页面作图问题:饼,堆积图,百分比堆积图 JAVA WEB网站,首页可以进去,是一个登录页面,输入帐号密码登录后,500错误 请指教高手 求教一个传值问题!!
request.getParameter("id");
1.jsp程序如下:
<html>
<head>
<title></title>
</head>
<script language="javascript">
function winopen(x)
{
window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
<body>
<%
int a[] = {1,2,3,4,5};
%>
<%
for (int i=0;i<5;i++)
{
%>
<a href="javascript:winopen(<%=a[i]%>)">连接<%=i%></a><br><br>
<%}%>
</body>
</html>2.jsp程序如下:
<html>
<head>
<title></title>
</head>
<body>
<%
String b = request.getParameter("id");
%>
本页是2.jsp,从1.jsp获得的值为:<%=b%>
</body>
</html>
表单的值不是同样的道理吗?呵呵~~~
function check()
{
document.yourformname.action = newwindow;
document.yourformname.target = _blank;
document.yourformname.submit();
}
第二页:
String strvalue = request.getParameter("variable");
that'all ok?
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script language="javascript">
function winopen(x)
{
alert(x);
window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head><body><form name="vote" method="POST" onsubmit="return winopen(window.document.vote.R1.value)">
<p><input type="radio" value="1" name="R1"><input type="radio" value="2" name="R1"><input type="radio" value="3" name="R1"><input type="radio" value="4" name="R1"><input type="radio" value="5" checked name="R1"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form></body></html>2.jsp:
同
为何得到是undefined呢?
1.jsp如下:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script language="javascript">
<!--
function winopen()
{
var x=document.vote.R1.value;
for (i=0;i<document.vote.R1.length;i++)
{
if (document.vote.R1[i].checked==true)
{
x=document.vote.R1[i].value;
break;
}
}
window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=yes");
}
-->
</script>
</head><body>
请选择:<br>
<form name="vote" method="post">
<p>
<input type="radio" value="1" name="R1">选项1
<input type="radio" value="2" name="R1">选项2
<input type="radio" value="3" name="R1">选项3
<input type="radio" value="4" name="R1">选项4
<input type="radio" value="5" name="R1" checked>选项5
</p>
<p>
<input type="button" value="提交" onclick="winopen()">
<input type="reset" value="全部重写" name="B2"></p>
</form></body></html>