javascript - iframe dynamic height doesn't work -
I have created a small widget that is basically a php file that contains an HTML AJAX based form. The height of the form depends on the production of AJAX reaction text. Therefore, I need to change the speed dynamically. I tried to do this with some code and it actually works well, but only on the local host file. This code works:
& lt; Iframe src = "ajax / cfw.php" id = "idIframe" width = "400px" onload = "iframe loaded ()" style = "border: none;" & gt; & Lt; / Iframe & gt; & Lt; Script type = "text / javascript" & gt; Function iframeLoaded () {var iFrameID = document.getElementById ('idIframe'); If (IFFROMId) // Here you can make the height, then I delete it first, then make it again the IFrameID. Hect = ""; IFrameID.height = IFrame Iocentent Window.document.body.scrollHeight + "px"; }} & Lt; / Script & gt;
However, when I try to IFrame the exact file I pointed out at my local host which does not host on my localhost, then it does not work:
& lt; Iframe src = "http://website.com/ajax/cfw.php" id = "idIframe" width = "400px" onload = "iframe loaded ()" style = "border: none;" & Gt; & Lt; / Iframe & gt;
Why is it, and how can I fix it? Thank you.
Comments
Post a Comment