<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tony Fendall &#187; Facebook</title>
	<atom:link href="http://blog.tonyfendall.com/category/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tonyfendall.com</link>
	<description>Welcome to my home on the web</description>
	<lastBuildDate>Sat, 14 Jan 2012 08:51:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook Iframe Resizing Solution</title>
		<link>http://blog.tonyfendall.com/2010/02/facebook-iframe-resizing-solution/</link>
		<comments>http://blog.tonyfendall.com/2010/02/facebook-iframe-resizing-solution/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:29:14 +0000</pubDate>
		<dc:creator>Tony Fendall</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IFrame]]></category>
		<category><![CDATA[Resizing]]></category>

		<guid isPermaLink="false">http://blog.tonyfendall.com/?p=70</guid>
		<description><![CDATA[ Recently I have been working on working with a Facebook application which resides within an iframe.&#160; However, the application could change size as the UI state changed, and the iframe needed to change size to match.
Luckily for me Facebook provide a prebuilt solution for this which you can drop into your page with only [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-right-width: 0px; margin: 0px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Magnifying Glass" border="0" alt="Magnifying Glass" align="left" src="http://blog.tonyfendall.com/wp-content/uploads/magnifying.jpg" width="173" height="206" /> Recently I have been working on working with a Facebook application which resides within an iframe.&#160; However, the application could change size as the UI state changed, and the iframe needed to change size to match.</p>
<p>Luckily for me Facebook provide a <a href="http://wiki.developers.facebook.com/index.php/Resizable_IFrame">prebuilt solution</a> for this which you can drop into your page with only a few lines of Javascript.&#160; They even provide a <a href="http://apps.facebook.com/wzhu_public_resize/">demo application</a>.</p>
<p>Unluckily for me, after following Facebook’s instructions perfectly, the resizing <strong>didn’t</strong> work!</p>
<p> <span id="more-70"></span>
<p>The behaviour I observed was:</p>
<table style="border-collapse: collapse; margin-bottom: 20px" cellspacing="0" cellpadding="8" width="600">
<tbody>
<tr>
<td style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" valign="top" width="149"><strong>Google Chrome            <br />Internet Explorer</strong></td>
<td style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" valign="top" width="451">
<p>The iframe would always open at 800px tall if the height of the            <br />content was less than 800px. The iframe would enlarge correctly             <br />if the contents grey beyond 800px tall, but it would never shrink.</p>
</td>
</tr>
<tr>
<td style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" valign="top" width="149"><strong>Mozilla Firefox</strong></td>
<td style="border-bottom: black 1px solid; border-left: black 1px solid; border-top: black 1px solid; border-right: black 1px solid" valign="top" width="451">The iframe resizing worked perfectly <strong>?!</strong></td>
</tr>
</tbody>
</table>
<p>I confirmed that the demo application Facebook provided worked correctly in all browses, but I just couldn’t get mine to work the same.&#160; Eventually I removed lines from the Facebook demo application one-by-one until I discovered what caused my error.</p>
<p>In the end it turns out that it was simply a case of my application not specifying a DOCTYPE in the main html page.&#160; After I inserted the DOCTYPE tag from the demo application everything worked perfectly.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</p>
</blockquote>
<p>It’s a pity that Facebook didn’t mention anywhere in their documentation that this line is critical to the operation of the iframe resizing code.&#160; I’m glad things are working for me now though, and hopefully other people will be able to learn from my mistake.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tonyfendall.com/2010/02/facebook-iframe-resizing-solution/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
