<html> <head> <script type="text/javascript"> function getContent(){ var doc; if (document.all){//IE doc = document.frames["MyIFrame"].document; }else{//Firefox or Chrome doc = document.getElementById("MyIFrame").contentDocument; } var content = doc.body.innerHTML; alert(content); } </script> </head> <body> <iframe id = "MyIFrame" name = "MyIFrame" src = "MyIFrame.htm" width = "100" height="100" οnlοad="getContent()"> </body> </html> 此外,iframe支持onload事件~