frameset布局時frame中src路徑的頁面沒有加載的解決方法
更新時間:2013年10月28日 16:30:40 作者:
使用frameset布局時,frame 中src路徑的頁面沒有加載的情況,想必大家都有感觸吧,下面是具體的解決方法,感興趣的朋友可以參考下
解決方法:將頁面的body節(jié)點去掉,錯誤代碼如下
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>主頁</title>
</head>
<body>
<frameset rows="15%,70%,15%" frameborder="yes" >
<frame scrolling="auto" src="IndexTop.jsp"></frame>
<frame scrolling="auto" src="IndexMain.jsp"></frame>
<frame scrolling="auto" src="IndexBottom.jsp"></frame>
</frameset>
</body>
</html>
由于frameset是一種框架結(jié)構(gòu),將整個頁面占據(jù)掉,不要用body進行布局
復制代碼 代碼如下:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>主頁</title>
</head>
<body>
<frameset rows="15%,70%,15%" frameborder="yes" >
<frame scrolling="auto" src="IndexTop.jsp"></frame>
<frame scrolling="auto" src="IndexMain.jsp"></frame>
<frame scrolling="auto" src="IndexBottom.jsp"></frame>
</frameset>
</body>
</html>
由于frameset是一種框架結(jié)構(gòu),將整個頁面占據(jù)掉,不要用body進行布局
相關(guān)文章
SSH整合中 hibernate托管給Spring得到SessionFactory
Spring文件中的 SessionFactory中 加入為了能得到同一個Session2009-06-06
JSP 開發(fā)之servlet中調(diào)用注入spring管理的dao
這篇文章主要介紹了JSP 開發(fā)之servlet中調(diào)用注入spring管理的dao的相關(guān)資料,需要的朋友可以參考下2017-05-05
jsp簡單連接SQL Server2000數(shù)據(jù)庫的方法
這篇文章主要介紹了jsp簡單連接SQL Server2000數(shù)據(jù)庫的方法,較為詳細的分析了JSP連接SQL Server2000數(shù)據(jù)庫的相關(guān)設置技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10

