Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook likebox which code is better

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.

like image 443
Lemdor Avatar asked Jun 13 '12 07:06

Lemdor


People also ask

What is the like box and how does it work?

The Like Box is a special version of the Like Button designed only for Facebook Pages. It allows admins to promote their Pages and embed a simple feed of content from a Page into other sites.

How does the page plugin work with like box?

The Page Plugin allows you to embed a simple feed of content from a Page into your websites. If you did not manually upgrade to the Page Plugin, your Like Box plugin implementation will automatically fall back to the Page Plugin.

What happened to the like box plugin in graph API?

With the release of Graph API v2.3, the Like Box plugin is deprecated. Please use the new Page Plugin instead. The Page Plugin allows you to embed a simple feed of content from a Page into your websites.


2 Answers

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).

like image 144
CBroe Avatar answered Oct 17 '22 20:10

CBroe


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.

like image 5
Oklahomer Avatar answered Oct 17 '22 21:10

Oklahomer