日期:2014-05-16 浏览次数:20564 次
<script>
function addEvent(o, evt, func) {
if (o.addEventListener) o.addEventListener(evt, func, false);
else if (o.attachEvent) o.attachEvent('on' + evt, func);
}
function addDocClickEvt(ifr) {
addEvent(ifr.contentWindow.document, click, function () {alert('点击了iframe里面的内容') });
}
</script>
<div id="iframeContain">
<iframe src='xxx.html' onload="addDocClickEvt(this)"></iframe>
</div>