【发布时间】:2019-04-13 20:39:19
【问题描述】:
A.html
var iframe = document.querySelector('#test');
// iframe.src = 'B.html'
iframe.onload = window(){
testFunction();
}
B.html
window.onload = window(){
console.log('B.html');
}
我想要“console.log('B.html') -> TestFunction();”
但是TestFunction();总是先执行。(B.html onload 不起作用。) 帮帮我……
【问题讨论】:
-
为什么不在
B.html中调用testFunction();。 -
我希望 B.html onload 先执行,A.html 执行
-
这两个文件是怎么加载的?
标签: javascript html jsp web iframe