Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html IFrames有问题吗_Html_Iframe - Fatal编程技术网

Html IFrames有问题吗

Html IFrames有问题吗,html,iframe,Html,Iframe,我在HTML中遇到了一个奇怪的问题。我已经测试了几个使用IFrame的站点,它们都有按钮、链接、JavaScript等等,我很确定,IFrame只是一片空白。然后,当我创建一个简单的HTML文档时,例如: <!DOCTYPE html> <html> <body> <p> Hello! This is a test! </p> </body> </html> 并在该文档上使用IFrame,如: <!DOC

我在HTML中遇到了一个奇怪的问题。我已经测试了几个使用IFrame的站点,它们都有按钮、链接、JavaScript等等,我很确定,IFrame只是一片空白。然后,当我创建一个简单的HTML文档时,例如:

<!DOCTYPE html>
<html>
<body>
<p> Hello! This is a test! </p>
</body>
</html>
并在该文档上使用IFrame,如:

<!DOCTYPE html>
<html>
<body>
<iframe src="iframetest.html"></iframe> 
</body>
</html>

它起作用了。我已经用多种浏览器测试过Safari、Firefox、Chrome,但都不起作用。如果我想用按钮、链接等做一些事情,我的IFrame是否还需要包括其他内容?我需要再做一个文件吗?现在我没有任何其他CSS文件或JavaScript文件。只是HTML。我需要使用IFrame显示一个带有按钮、链接、JavaScript等的网站。但正如我之前所说,带有按钮、链接、JavaScript等的网站不适合我使用IFrame。

我不确定你到底想做什么?我编辑了我的文章最后一句话。你的IFrame必须自己引用css和JavaScript。你需要包含css,iframetest.html页面中的javascript所以我必须下载.css和.js文件,并将它们与IFrame链接在文件中?我应该在哪里引用css和javascript?