<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adjusting the height of iframes to match the content across domains</title>
	<atom:link href="http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/</link>
	<description>Matthew Nuzum&#039;s Blog</description>
	<lastBuildDate>Mon, 26 Jul 2010 07:26:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: matt</title>
		<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/comment-page-1/#comment-144</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Thu, 08 May 2008 10:39:55 +0000</pubDate>
		<guid isPermaLink="false">#comment-144</guid>
		<description>OK, I&#039;ve done my research, I think I was imagining the past ability to remove items from the history. However, here&#039;s a solution that decreases the chances of breaking the back button in the browser:

__In the parent frame__: (instead of what&#039;s shown above)

&lt;code&gt;    &lt;lt;iframe src=&quot;http://path/to/iframe.html&quot; width=&quot;100%&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; id=&quot;downloadframe&quot; style=&quot;height:350px&quot;&gt;&lt;/iframe&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        function checkFragment() {
            h = document.location.href.indexOf(&#039;#h&#039;);
            l = document.location.href.length;
            if( h &gt; 0) {
                u = document.location.href.substring(h+2,l);
                // u will be like 312 or 312-123456 and we only want the 312
                height = parseInt(u.split(&#039;-&#039;)[0]);
                setFrameHeight(height);
                clearInterval(frameint);
                // fix for browsers whose navigation gets confused by this script
                if(history.length &gt; his)
                    history.go(-1)
            }
        }

        function setFrameHeight(height)
        {
            var frame = document.getElementById(&quot;downloadframe&quot;);
            frame.height = height + 20; // there&#039;s a bit of scroll without the 20
        }
        // used for fixing the history in ff
        his = history.length
        // our interval
        var frameint = self.setInterval(&#039;checkFragment()&#039;, 500);
    &lt;/script&gt;
&lt;/code&gt;
Again, feedback is welcome.</description>
		<content:encoded><![CDATA[<p>OK, I&#8217;ve done my research, I think I was imagining the past ability to remove items from the history. However, here&#8217;s a solution that decreases the chances of breaking the back button in the browser:</p>
<p>__In the parent frame__: (instead of what&#8217;s shown above)</p>
<p><code>    <lt ;iframe src="http://path/to/iframe.html" width="100%" frameborder="0" marginheight="0" marginwidth="0" id="downloadframe" style="height:350px">&lt;/iframe><br />
    &lt;script type="text/javascript"><br />
        function checkFragment() {<br />
            h = document.location.href.indexOf('#h');<br />
            l = document.location.href.length;<br />
            if( h > 0) {<br />
                u = document.location.href.substring(h+2,l);<br />
                // u will be like 312 or 312-123456 and we only want the 312<br />
                height = parseInt(u.split('-')[0]);<br />
                setFrameHeight(height);<br />
                clearInterval(frameint);<br />
                // fix for browsers whose navigation gets confused by this script<br />
                if(history.length > his)<br />
                    history.go(-1)<br />
            }<br />
        }</p>
<p>        function setFrameHeight(height)<br />
        {<br />
            var frame = document.getElementById("downloadframe");<br />
            frame.height = height + 20; // there's a bit of scroll without the 20<br />
        }<br />
        // used for fixing the history in ff<br />
        his = history.length<br />
        // our interval<br />
        var frameint = self.setInterval('checkFragment()', 500);<br />
    &lt;/script><br />
</lt></code><br />
Again, feedback is welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/comment-page-1/#comment-80</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Unknown, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-80</guid>
		<description>Joel, I&#039;m sorry to say that this won&#039;t work for you. There still needs to be a level of communication between both sites. However it is still better than some solutions because you only need two pages, the parent and the child frame (some solutions require a third page embedded in the child frame, hosted in the same domain as the parent).

Still not a solution to Joel&#039;s problem but another idea that may work and not have the nasty page-refresh problem in firefox is http://ajaxian.com/archives/whats-in-a-windowname</description>
		<content:encoded><![CDATA[<p>Joel, I&#8217;m sorry to say that this won&#8217;t work for you. There still needs to be a level of communication between both sites. However it is still better than some solutions because you only need two pages, the parent and the child frame (some solutions require a third page embedded in the child frame, hosted in the same domain as the parent).</p>
<p>Still not a solution to Joel&#8217;s problem but another idea that may work and not have the nasty page-refresh problem in firefox is <a href="http://ajaxian.com/archives/whats-in-a-windowname" rel="nofollow">http://ajaxian.com/archives/whats-in-a-windowname</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/comment-page-1/#comment-101</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Unknown, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-101</guid>
		<description>So... just so I&#039;m clear -- your addendum only modified step #2 of your original instructions, right? I&#039;d still need to embed the mootools stuff within the document that will be appearing in the iframe?

I initially thought your solution was the one i was looking for, but it doesn&#039;t appear to be...

I&#039;m looking for a something that will work without having to attach anything to the pages that will be appearing within the frame. The site I administer will be featuring a few third-party solutions that we&#039;d like to frame within our template. And I can&#039;t modify those pages and add scripts to them. 

But I hate the scroll bars people inevitable have to wrestle with when these pages grow outside of the dedicated frame size. So... I&#039;ll keep looking for options unless I&#039;m not understanding correctly how to implement your solution.

Thanks for your work, though. Looks like good stuff. And your site looks interesting, too. I love running into techy theologians like myself :)</description>
		<content:encoded><![CDATA[<p>So&#8230; just so I&#8217;m clear &#8212; your addendum only modified step #2 of your original instructions, right? I&#8217;d still need to embed the mootools stuff within the document that will be appearing in the iframe?</p>
<p>I initially thought your solution was the one i was looking for, but it doesn&#8217;t appear to be&#8230;</p>
<p>I&#8217;m looking for a something that will work without having to attach anything to the pages that will be appearing within the frame. The site I administer will be featuring a few third-party solutions that we&#8217;d like to frame within our template. And I can&#8217;t modify those pages and add scripts to them. </p>
<p>But I hate the scroll bars people inevitable have to wrestle with when these pages grow outside of the dedicated frame size. So&#8230; I&#8217;ll keep looking for options unless I&#8217;m not understanding correctly how to implement your solution.</p>
<p>Thanks for your work, though. Looks like good stuff. And your site looks interesting, too. I love running into techy theologians like myself <img src='http://www.bearfruit.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt</title>
		<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/comment-page-1/#comment-244</link>
		<dc:creator>matt</dc:creator>
		<pubDate>Unknown, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-244</guid>
		<description>I&#039;m not sure I understand what you mean. It does not create any new HTML, the top frame merely adjusts the height of the iframe to match what it was told by the javascript running in the iframe. The javascript communicates this information by changing the URL of the top frame, however that URL shouldn&#039;t cause anything to actually happen since it&#039;s only changing the hash fragment to something that wouldn&#039;t normally exist.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I understand what you mean. It does not create any new HTML, the top frame merely adjusts the height of the iframe to match what it was told by the javascript running in the iframe. The javascript communicates this information by changing the URL of the top frame, however that URL shouldn&#8217;t cause anything to actually happen since it&#8217;s only changing the hash fragment to something that wouldn&#8217;t normally exist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tammy M Freeman</title>
		<link>http://www.bearfruit.org/2008/05/08/adjusting-the-height-of-iframes-to-match-the-content-across-domains/comment-page-1/#comment-254</link>
		<dc:creator>Tammy M Freeman</dc:creator>
		<pubDate>Unknown, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-254</guid>
		<description>Hello,

Firstly, thank you so much for this script. I do have one question though. So when you script runs, it creates something like a new html instead of updating the page where the iframe is held. Is there anyway around that? I only ask because the whole reason Im using the iframe is to be able to center the page and bc it goes back to the source page, it is uncentered. Any help would be appreciated....thanks again!</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Firstly, thank you so much for this script. I do have one question though. So when you script runs, it creates something like a new html instead of updating the page where the iframe is held. Is there anyway around that? I only ask because the whole reason Im using the iframe is to be able to center the page and bc it goes back to the source page, it is uncentered. Any help would be appreciated&#8230;.thanks again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
