我的一个页面,是frameset的一部分,点击提交后先到一个参数的接收和处理页面,然后通过response.sendRedirect实现跳转,跳转后该部分的frame是跳转了,可是另一部分还是原来的样子,而我想要的是整个frame都显示成我的新页面。我用到了window.location.href,可是不知道怎么回事竟然不行,请各位帮忙看一看out.println("<script language='javascript'>"
+"var iam=document.getElementById('iam').value;"
+"var timename=document.getElementById('timename').value;"
+"var kpino=document.getElementById('k').value;"
+"var resid=document.getElementById('r').value;"
+"var datefromto=document.getElementById('datefromto').value;"
+"var timetype=document.getElementById('timetype').value;"
+"window.top.location.href=\'"+ctxPath+"/common/result.jsp?"
+"&iam='+iam+'"
+"&portalid=pm50004"
+"&timename='+timename+'"
+"&kpino='+kpino+'"
+"&resid='+resid+'"
+"&datefromto='+datefromto+'"
+"&timetype='+timetype+'"
+"</script>");
response.sendRedirect(ctxPath+"/common/result.jsp?iam="
+ iam
+ "&timename="
+ timename
+ "&portalid=pm50004"
+ "&kpino="
+ kpino
+ "&resid="
+ resid
+ "&datefromto="
+ datefromto
+ "&timetype="
+ timetype);
+"var iam=document.getElementById('iam').value;"
+"var timename=document.getElementById('timename').value;"
+"var kpino=document.getElementById('k').value;"
+"var resid=document.getElementById('r').value;"
+"var datefromto=document.getElementById('datefromto').value;"
+"var timetype=document.getElementById('timetype').value;"
+"window.top.location.href=\'"+ctxPath+"/common/result.jsp?"
+"&iam='+iam+'"
+"&portalid=pm50004"
+"&timename='+timename+'"
+"&kpino='+kpino+'"
+"&resid='+resid+'"
+"&datefromto='+datefromto+'"
+"&timetype='+timetype+'"
+"</script>");
response.sendRedirect(ctxPath+"/common/result.jsp?iam="
+ iam
+ "&timename="
+ timename
+ "&portalid=pm50004"
+ "&kpino="
+ kpino
+ "&resid="
+ resid
+ "&datefromto="
+ datefromto
+ "&timetype="
+ timetype);
js的parent.window.location.href 进行转向
别用response.sendRedirect试试看
<frame src="/nms/check/pm/topdiv.jsp" marginWidth=0 marginHeight=0 scrolling="no" name="newadddiv" id="newadddiv" noresize="noresize">
<frameset cols="250,*" border="0" framespacing="4" frameborder="no">
<frame src="/nms/check/pm/menutreebizman.jsp" name="custleft" id="custleft" marginWidth=0 marginHeight=0 scrolling="no">
<frame src="selectkpikbpcustom.jsp" name="custright" id="custright" scrolling="no">
</frameset>
</frameset>这是我的frame结构