14.4 window.name
2021-06-16 15:06
标签:引用 style fir exp func name get listen lse a.html b.html 空页面 c.html 服务端 a.js b.js 14.4 window.name 标签:引用 style fir exp func name get listen lse 原文地址:https://www.cnblogs.com/zouxinping/p/10346737.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>
script>
window.name = ‘我不爱你‘
script>
let express = require(‘express‘)
let app = express()
app.use(express.static(__dirname))
app.listen(3000)
let express = require(‘express‘)
let app = express()
app.use(express.static(__dirname))
app.listen(4000)