首先使用bootStrap样式,将页面进行左右分割
(1)jsp面板中,但是具体样式,可以根据自己合理定制,首先在父页面index.jsp中插入iframe
<div class="row"> <div class="col-xs-4">
//左侧加入需要的信息 </div> <div class="col-xs-8"> <iframe name="content" id="iframePage" frameborder="0" width="100%" height="500px" style="overflow:hidden;"></iframe> </div> </div>
并在index.jsp中加入相关的js信息:
<script src="${pageContext.request.contextPath}/jpath /index.js?t=<%=System.currentTimeMillis() %>"></script>
说明:jpath是index.js的路径信息,System.currentTimeMillis()是系统的当前时间毫秒数,目的是不断更新index.jsp中加载js信息
index.js中iframe中页面的显示:frames['content'].location.href = 路径信息 //location.href直接在当前页面的指定部分中显示
index.js中使用函数:
function reloadTree(){ console.log('aaaaaaaaa'); }
(2)父级页面index.jsp的子级页面detail.jsp中,则子级页面中调用父级页面信息
parent.reloadTree();