[英]window.frames returns only the base window
我正在尝试访问插入的 iframe 的window
对象。 当我在检查中检查window.frames
时,它是基础窗口的窗口对象而不是iframe之一,并且window.frames.length
为1。如何访问iframes的窗口对象?
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<script src="script.js" defer></script>
</head>
<body>
some contents
<iframe src="iframe.html"></iframe>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.