Web Tech Guide

www.blogsmonetize.com feed

How to Fix Facebook Likebox Code to Have Valid XHTML

 

Normally, you just set up and copy the Facebook Likebox code into your website

<iframe  src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=true&amp;height=62"  scrolling="no" frameborder="0" style="border:none;  overflow:hidden; width:292px; height:62px;" allowTransparency="true"></iframe>

If you do so, the XHTM validator will give you the following error:

there is no attribute " allowTransparency "

However, IE needs allowTransparency = "true" to work, you can work this around by modifying the Facebook Likebox with if statement for IE as follow:

<!--[if IE]
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=true&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:62px;" allowTransparency="true"></iframe>
<![endif]--> <!--[if !IE]>-->
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=true&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:62px;"></iframe>
<!--<![endif]-->

Or, you can also use the following code

<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=true&amp;height=62" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:62px;" <!--[if ie]> allowTransparency="true" <![end if]-->
></iframe>

Now you have a valid XHTML Facebook Likebox code.


© 5/28/2011 10:26:00 AM www.blogsmonetize.com
Loading related posts...

0 comments:

Post a Comment