iframe 的使用!

sgp1201 2003-11-04 11:20:55
有两个网页:index.html和test.html
我想在index.html中的一个地方把test.html嵌入进来,形成一体,但为什么在front
page 中显示是正确的,但实际运行index.html却会自动转到test.html。代码如下:
index.html
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>首页</title>
</head>
<body>
<p align=left>
<!--<DIV id=kq align=center style="VISIBILITY: hidden">-->
!--<IFRAME frameBorder=0 height=22 marginHeight=0 marginWidth=0 scrolling=no src="test.html" width=120></IFRAME>-->
<iframe name="T1" marginHeight=1 marginWidth=1 scrolling=no src="test.html" width="200" border="0" frameborder="0" >
</iframe>
<!-- </DIV>-->
</body>
</html>
...全文
31 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
blueice2002 2003-11-05
  • 打赏
  • 举报
回复
是啊,没有问题啊
sgp1201 2003-11-05
  • 打赏
  • 举报
回复
不好意思,我忘了,在test.html我加了这两句
if (top.location !== self.location) {
top.location=self.location;
}

function window_onload() {

usernameshow.focus();

}
tuoshi 2003-11-04
  • 打赏
  • 举报
回复
正解啊,没问题的,只是在12行少了一个 < 。
zyzy15 2003-11-04
  • 打赏
  • 举报
回复
其实不是自动转到test.html,而是由于将frameborder设置为"0"而看不到边框了。
将 frameborder="0" 删除或是在body里加点东西看看 :)

61,125

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧