HI:

I paste my script below:

<html>
    <head>
        <script src="http://code.activestate.com/js/jquery-1.2.1.js";
type="text/javascript"></script>

        <script language="javascript" type="text/javascript">
            function onLoad() {
                var frame1 = $("#frame1");
                alert("1");
                var innerDoc = (frame1.get(0).contentDocument) ?
frame1.get(0).contentDocument : frame1.get(0).contentWindow.document;
                alert("2");
                var b=innerDoc.body;
                alert("3");
                alert(innerDoc.body.scrollHeight);
            }
        </script>

    </head>
    <body>
        <iframe  id="frame1" src="http://www.baidu.com"; width=100%
onload="onLoad()">
        </body>
    </html>

The script only alert "1" in IE and alert "2" in firefox. It seems
stop execute after then.


Does any guy know why?

I took this idea from this link:
http://jbscdev.blogspot.com/2007/08/automatic-iframe-height-sizing-using.html

Reply via email to