Frame加载顺序
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
document.onreadystatechange = doLoad; //当页面加载状态改变的时候执行这个方法.
function doLoad() {
if (document.readyState == "complete" && window.parent.frames["frmTest1"].document.readyState == "complete") {//当页面加载状态为完全结束时进入
frmUrl = "test.html";
document.getElementById("frmTest2").src = frmUrl;
}
}
<frame id="frmTest1" name="contents" scrolling="yes" src="test1.html" >
<frame id="frmTest2" name="contents" scrolling="yes" src="" >