为了账号安全,请及时绑定邮箱和手机立即绑定

frame引用窗口并没有其作用?

frame引用窗口并没有其作用?

1.html<!DOCTYPE html><html lang="en"><head>     <meta charset="UTF-8">     <title>Document</title></head><frameset cols="50%,50%">     <frame src="red.html" name="redFrame">     <frame src="blue.html" name="blueFrame"></frameset><script>     alert(top.frames["redFrame"].color)</script></html>red.html<!DOCTYPE html><html><head><title>redFrame</title><style>     body{ background-color: red; }</style></head><body>     <script>         window.color = "red";    </script></body></html>blue.html<!DOCTYPE html><html><head><title>blueFrame</title><style>     body{ background-color: blue; }</style></head><body></body></html>我打开1.html并没有弹出弹框 然后看了控制台,发现我的script没有了 这是为什么? 后来我把script写到head里面 就能弹出red字样的弹框了 这是为啥?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 700 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信