iframe。在其中显示另一个html页面;最简单的实现是什么?
这是我试过的 在html主页中iframe。在其中显示另一个html页面;最简单的实现是什么?,html,iframe,Html,Iframe,这是我试过的 在html主页中 <iframe src="./example.html" id="frame" frameborder="1"></iframe> example.html如下所示 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htm
<iframe src="./example.html" id="frame" frameborder="1"></iframe>
example.html如下所示
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
</head>
<body>
<p>YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO</p>
</body>
例子
呜呜呜呜呜呜呜呜呜呜
这将导致iframe为空
--更新--
好的,问题是仅仅刷新页面并没有更新iframe。但当我把它关起来重新打开时,一切都很好。有人能解释一下吗?iFrame是否需要刷新?Example.html应该是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example</title>
</head>
<body>
<p>YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO</p>
</body>
</html>
例子
呜呜呜呜呜呜呜呜呜呜
还要确保您的iframe中指向example.html的路径正确,并且具有设置的高度和宽度。您得到的是空的iframe吗?控制台中有任何错误吗?您确定src正确吗?在example.html的末尾添加
,以防您没有它…@Sergio Yes empty iframe。。补充说,这是失踪,但没有改变欢呼。Mataniko是的我认为src是对的。。它是一个名为example.html的文件,与主html文件位于同一文件夹中,在ITI中包含iframe如果您查看主html的源代码并遵循iframe src的链接(单击查看源代码中的链接),会发生什么?