---
title: "如何判断iframe中的页面加载完毕"
author: "lost_alien"
date: "2010-11-18T17:28:26Z"
tags: []
categories: ["Web前端"]
slug: "iframe"
draft: false
lastmod: "2010-11-18T17:28:26Z"
id: 815306
url: "https://lost-alien.iteye.com/blog/815306"
---

<iframe id="aaa" src=" http://www.baidu.com"></iframe>

<script type="text/javascript">

var a = document.getElementById('aaa');
var iframeLoad = function(){
	alert('IFRAME加载完成了!!');
}
if(!a.addEventListener){
	a.attachEvent('onload', iframeLoad)
}
a.addEventListener('load', iframeLoad, true);
</script>