Resizing div after iframe change src

So I automatically resize my iframe based on content height as follows:

<iframe name="main" id="main" src="main.php" frameborder=0 scrolling="no" onload="this.style.height = main.document.body.scrollHeight + 5; this.style.width = main.document.body.scrollWidth">

However, I also use a link to change the src (utilizing target if anyone was wondering), but my iframes vary heights vastly, and after changing back to the shorter one, my methods of resizing the div/document body haven't worked...

ex.

<a href="mail.php" onclick="document.getElementById("content").style.height = main.document.body.scrollHeight" target="main">

Any suggestions?

Answers


Div resize was working fine, provided I fix the double quotes...the problem was that the iframe wasn't resizing after changing source, got it working now though...Thanks


Need Your Help

Open Website in background using python

python

I need to open a website in background, and after few seconds of loading, download everything on the page.

How to remove JS logging calls in our prod build of our mvc3 web app?

javascript asp.net-mvc-3 bundling-and-minification

We've got a lot of calls to our logging methods (that just wrap console.log) all throughout our JS in our MVC3 web app and I'd like to remove them from the JavaScript when we build our test and