facebook likebox which code is better
Asked Answered
B

2

6

I'm putting the facebook LikeBox plugin on a webpage i'm working on. it's built on HTML & CSS & JavaScript.

I wanted to know which code would be the best to use since there are three options...for example, for less load time. HTML5 or XFBML or IFRAME? i would really appreciate it if anyone can Please refer me your suggestions. thank you.

Burton answered 13/6, 2012 at 7:30 Comment(0)
A
5

They are using JavaScript to parse XFBML/HTML5 and convert them to iframe.
So if you are just showing plugins, any of them work, but HTML5 and XFBML give you more options.
For instance, iframe version of Like Button doesn't provide you an option to display "Send" button, but HTML5 and XFBML do.
And HTML5/XFBML versions give you a chance to set callback functions.

So, if you need or want to customize, HTML5 and XFBML are better.
Using HTML5 or XFBML totally depends on you.
When you are coding your website in HTML5 and want your markup be legal, HTML5 version would be nice.

Abernathy answered 13/6, 2012 at 7:45 Comment(0)
T
8

If you’re using the HTML5 or XFBML version, you have to load Facebook’s JavaScript SDK – so that counts for your page’s load time, since it’s an external script resource directly embedded into your code. (Although normally loading is done asynchronously, so it won’t slow loading of the rest of your page down much and also won’t delay the load event.)

The iframe version on the other hand loads „on it’s own”, so to speak. Only the iframe element’s code is in your page, and loading it’s actual content is considered as loading a completely unrelated page by the browser. So how ever much time it’ll take the iframe document to load (in case of Facebook being „down” or slow temporarily), it won’t affect your own page and it’s load event in any way.

Despite these facts, I’d normally go with either the HTML5 or XFBML version – not so much based on the described factors, but rather because I feel I have more „control” over them (for example not activating them straight away, but maybe have them parsed only later on some user interaction with the page or so).

Thorma answered 13/6, 2012 at 7:49 Comment(0)
A
5

They are using JavaScript to parse XFBML/HTML5 and convert them to iframe.
So if you are just showing plugins, any of them work, but HTML5 and XFBML give you more options.
For instance, iframe version of Like Button doesn't provide you an option to display "Send" button, but HTML5 and XFBML do.
And HTML5/XFBML versions give you a chance to set callback functions.

So, if you need or want to customize, HTML5 and XFBML are better.
Using HTML5 or XFBML totally depends on you.
When you are coding your website in HTML5 and want your markup be legal, HTML5 version would be nice.

Abernathy answered 13/6, 2012 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.