Click here to Skip to main content
15,867,834 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I want to build a page having custom Google search with dynamic Iframe height.(No Scroll bar in the iframe).

i have tried this
JavaScript
<script language="JavaScript">
  function autoResize(id){
  var newheight;
  var newwidth;

  if(document.getElementById){
    newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
    newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
  }

  document.getElementById(id).height= (newheight) + "px";
  document.getElementById(id).width= (newwidth) + "px";
}
</script>

Code:
HTML
<IFRAME width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0"  önLoad="autoResize('iframe1');"></iframe>

its not working.

I searched in Google but didn't find any solutions.

Please Help
Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900