para ajustar el iframe a su altura de contenido

        <script language="JavaScript">
        function autoResize(id){
            alert('check');
            var newheight;
            var newwidth;

            if(document.getElementById){
                newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
                newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
            }
            alert(newheight);
            alert(newwidth);
            document.getElementById(id).height= (newheight) + "px";
            document.getElementById(id).width= (newwidth) + "px";
        }
        </script>

HTML:

            <iframe id="faq_iframe" src="http://www.google.com" width="100%" height="200px" scrolling="no" frameborder="0" marginheight="0" onload="javascript: autoResize('faq_iframe');"></iframe>

Pregunta: Estoy usando iframe para mostrar mi página. Necesito ajustar el iframe a la altura de mi página, ¿cómo puedo hacer esto?

Había intentado los códigos anteriores

recibí este error a través de Firebug

Permission denied for <http://localhost> to get property Window.document from <http://www.google.co.in>.
[Break On This Error] newheight=document.getEleme...tWindow.document.body.scrollHeight; 

Cómo hacer que el iframe se ajuste a su altura a la altura de mi página dada en iframe src

Respuestas a la pregunta(5)

Su respuesta a la pregunta