frame 之间怎么 传值?

来源:百度知道 编辑:UC知道 时间:2024/06/30 10:32:45
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<frameset id="upFrame" name="upFrame" cols="20%,*" framespacing="0">

<frameset rows="*,50%" cols="*" framespacing="0" frameborder="NO" border="0">

<frame name="h1" src=h1.jsp>
<frame name="h2" src=h2.jsp >

</frameset>
<frame name="h3" src=h3.jsp" >

<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>

#####################################################

问: h1中的值 怎么传到h3中,不要刷页面?
不刷新 h3的页面!

URL传值,也可以用session或者request
h1中有个<% String s="abc"; %>
写<%request.setAttribute("set",s); %>

h3中写<%request.getAttribute("set"); %>
则h3中显示abc

或者:

h1中有个<% String s="abc"; %>
写<%session.setAttribute("set",s); %>

h3中写<%session。getAttribute("set"); %>
则h3中显示abc

恩,URL传值,也可以用session或者request
h1中有个<% String s="abc"; %>
写<%request.setAttribute("set",s); %>

h3中写<%request.getAttribute("set"); %>
则h3中显示abc

或者:

h1中有个<% String s="abc"; %>
写<%session.setAttribute("set",s); %>

h3中写<%session。getAttribute("set"); %>
则h3中显示abc

不刷基本上不太可能,去看看Ajax是否有实现的办法吧。

一般是使用超连接可以做到传值 在超连接的里加入属性target="xx.jsp?arg1?value1&arg2?value2"