I want to resize the height of Iframe dynamically on the content of the IFrame's src URL and the this src is coming through Webserv开发者_运维百科ice method.
please help any one..thanks
When the website is from the same domain, you can use this code, which expands the frame as much as possible:
var frame = document.getElementById("name_of_iframe");
var contentframe = document.frames["name_of_iframe"];
contentframe = (contentframe.contentDocument||contentframe.windowWindow.document).body;
frame.style.height = contentframe.scrollsetHeight + "px";
frame.style.width = contentframe.scrollWidth + "px";
精彩评论