復制代碼 代碼如下:
<script type="text/javascript">
function getIframeContent(){ //獲取iframe中文檔內容
var doc;
if (document.all){//IE
doc = document.frames["MyIFrame"].document;
}else{//Firefox
doc = document.getElementById("MyIFrame").contentDocument;
}
return doc.body.innerHTML;
}
</script>