【发布时间】:2020-10-21 14:51:03
【问题描述】:
我想在脚本加载时弹出 iframe src(domain)。 我编写了简单的代码,但它不起作用。
<html>
<title>Iframe load</title>
<iframe src="https://evil.com/" id="site" width="800px" heigth="700px"></iframe>
<script>
var siteD = document.getElementById("site");
alert(siteD);
</script>
</html>
当页面加载时它只显示我[object HTMLIFrameElement]。但我想在来自 src 的弹出窗口evil.com 中显示。希望你能理解我的问题。
【问题讨论】:
-
你应该使用
console.log
标签: javascript html xss