Archive for html

Facebook Iframe Application: Resize Iframe

If you are using Rails and Facebooker, and you have a resizable Iframe application and you are having problems with resizing, do the following:

a) Make sure that the Iframe is set to Resizable in the Facebook appplication settings.

b) Instead of calling just <%= init_fb_connect "XFBML" %> (as mentioned in all the tutorials), use

<% init_fb_connect "XFBML" do %>
FB.CanvasClient.startTimerToSizeToContent();
<% end %>

This should automatically resize your Iframe in the facebook canvas

Leave a Comment

Div inside a p : Invalid HTML

I was trying to center an element using the p tag. Like :
<p style="margin-left:auto; magin-right:auto; width: 50 em;">
<%= show_simple_captcha %>
</p>

show_simple_captcha is a helper method from the simple captcha rails plugin. This view helper generates a div which helps in captcha validation. Now, this created a problem. This piece of code started to behave randomly in IE. Even the source generated in Firefox is invalid HTML. After much scratching arnd, I found that <div> tags are not allowed inside <p> tags. Strange !! I dont have a reason of the top of my head as to why this is disallowed, but this is invalid W3C HTML.

Leave a Comment