如何获得request.setAttribute中的值
展开全部
试试下面代码:
Html代码
<script type="JavaScript">
var list = [
<%
List list = (List) (request.getAttribute("promotionlist"));
for (Iterator it = list.iterator; it.hasNext();) {
out.print("\"" + it.next() + "\"");
if (it.hasNext()) out.println(", ");
}
%>
];
document.getElementById("iframeContent").promotionList = list;
</script>
然后到iframe页面,从iframe中取值
Javascript代码
var list = window.top.frames["promotionlist"].promotionList;
Html代码
<script type="JavaScript">
var list = [
<%
List list = (List) (request.getAttribute("promotionlist"));
for (Iterator it = list.iterator; it.hasNext();) {
out.print("\"" + it.next() + "\"");
if (it.hasNext()) out.println(", ");
}
%>
];
document.getElementById("iframeContent").promotionList = list;
</script>
然后到iframe页面,从iframe中取值
Javascript代码
var list = window.top.frames["promotionlist"].promotionList;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询