说明:
<frameset rows="10%,*" frameborder="yes" border="1" bordercolor="#CCCCCC">
<frame scrolling="no" src="tab.jsp" noresize="noresize">
<frame scrolling="auto" src="content.jsp" name="contentFrame" id="contentFrame" >
</frameset>
页面分为上下两个部分。上面是tab导航,下面是链接到的不同页面。当点击tab导航时,均在下面的frame中显示页面。
解决方法:
1)若在tab.jsp中是使用了<a href="http://www.baidu.com">baidu</a>打开新页面,
则在tab.jsp的<head></head>之间添加<base target="contentFrame">即可。
2)若在tab.jsp中的javascript中使用了window.open("http://www.baidu.com") 打开新页面,
则需要将其修改为window.open("http://www.baidu.com","contentFrame") 即可。
本文介绍了一种使用iframe实现页面导航的方法,通过在顶部设置固定的tab导航,点击不同的选项卡时,在下方的iframe中加载相应的页面内容。文章提供了两种解决方法:一是通过在包含链接的页面中使用base标签指定目标iframe;二是调整JavaScript中的window.open方法来指定目标iframe。
7269

被折叠的 条评论
为什么被折叠?



