14.4 window.name

2021-06-16 15:06

阅读:303

标签:引用   style   fir   exp   func   name   get   listen   lse   

a.html

 
iframe src="http://localhost:4000/c.html" frameborder="0" onload="load()" id="iframe">iframe>
script>
    let first = true
    function load() {
      if (first) {
        let iframe = document.getElementById(iframe)
        iframe.src = http://localhost:3000/b.html
        first = false
      } else {
        console.log(iframe.contentWindow.name)
      }
    }
script>

b.html  空页面

c.html

script>
    window.name = 我不爱你
script>

 

服务端

a.js

let express = require(express)
let app  = express()
app.use(express.static(__dirname))
app.listen(3000)

b.js

let express = require(express)
let app  = express()
app.use(express.static(__dirname))
app.listen(4000)

 

14.4 window.name

标签:引用   style   fir   exp   func   name   get   listen   lse   

原文地址:https://www.cnblogs.com/zouxinping/p/10346737.html


评论


亲,登录后才可以留言!