原文地址:http://blog.ops.cc/webtech/javascript/f5nhm.html

 

<body>

    <script>var iframe = document.createElement("IFRAME");

        document.body.appendChild(iframe);

        iframe.src = "http://www.ops.cc";



        if (iframe.attachEvent) {

            iframe.attachEvent("onload", function () {

                alert("Local iframe is now loaded.");

            });

        } else {

            iframe.onload = function () {

                alert("Local iframe is now loaded.");

            };

        }

    </script>

</body>