[JavaScript] Lazy Load Facebook Like Box To Speed up Page Loading












How to load Facebook like button on the scroll after page load using Jquery? Make Facebook like box asynchronous to loaded automatically on the scroll. Learn how to lazy load script files to improve page speed. Here on this site, we also use this method to asynchronous lazy-load other types of scripts. Stop searching to defer lazy loading of Facebook widgets to speed up page loading. Facebook like box always downloads extra data when the user visits each time your site which causes page loading time slow. The Facebook developer button with like Box is a special version of the LIKE Button designed for Facebook Pages. Showing "Like us on Facebook page" is easier but it cost much in terms of page loading. This method uses to defer both JavaScript + HTML Facebook button and follows all the rules by Facebook page developer. Learn how to add Facebook to website and how to defer the loading of Facebook like box by lazy load FB JavaScript for making page speed much faster.
Lazy Load Facebook Like Box To Speed up Page Loading
Lazy Load Facebook Like Box To Speed up Page Loading
In the category of Facebook, last time we have seen how to see locked profile picture hack, and today we are going to focus on page loading. We are going to use the better technique by lazy load script to defer loading of any widget. You can ignore the data downloaded by this widget but you need to concentrate its loading-time because it directly affects to your site loading-time.

Also read; 5 Advanced Tips For Making Blogger Blog To Load Faster

Defer Facebook Developer Button

For better page performance this is an essential tip and as the page content is more important than widgets, it is much better to make a delay loading of these widgets so that it will load only when the whole page gets loaded.

Lazy Load Facebook Like Box JavaScript

Add following code in your HTML widget. You just need to replace blue colored text as per your content.

<!-- lazy loading of Facebook widget -->
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
    $('#fbHolder').append('<div id="fb-root"></div>');
    $('#fbHolder').append('<fb:like-box href="http://www.facebook.com/ID" width="300" show_faces="true" stream="false" header="false"></fb:like-box>');
    jQuery.getScript('http://connect.facebook.net/en_US/all.js#xfbml=1', function() {
        FB.init({status: true, cookie: true, xfbml: true});
    });
});
//]]>
</script>
<!-- lazy loading of Facebook widget -->
<div id="fbHolder">
<!-- put here your old Facebook widget box code -->
</div>
A demo is working here on this site, or you can check its performance on Page Speed and Yslow, significantly you will see the changes in the report.

Vinayak SP
data:post.title [JavaScript] Lazy Load Facebook Like Box To Speed up Page Loading
4 stars - "[JavaScript] Lazy Load Facebook Like Box To Speed up Page Loading" How to load Facebook like button on the scroll after page load using Jquery? Make Facebook like box ...

(Flat 70% + Extra 30% Off) Amazon Offers

Rs.300 For Every Signup. Creat New account.
Amazon in Offers on Clothing Clothing & Accessories Todays Deals Great Savings Every Day
Prev Story
Next Post »
Read & Post Comments

COPYRIGHTS & USAGE

All of the ProBlogBooster ideas are free for any type of personal or commercial use. All I ask is to keep the footer links intact which provides due credit to its authors. From time to time, we may use visitors/readers, information for distinct & upcoming, unanticipated uses not earlier disclosed in our privacy notice. If collected data or information practices changed or improved at some time in the future, we would post all the policy changes to our Website to notify you of these changes, and we will use for these new purposes only data collected from the time of the policy change forward. If you are concerned about how your information is used, you should check back our website Policy pages periodically. For more about this just read out Privacy Policy








problogbooster®

Articles on Writing Unique Content

Making Blogger Responsive Mobile-friendly Template
Learn More About Responsive Web Development

Top 15 Must-Have Apps You Should Install
Right After Buying A New Smartphone

Making Blogger Responsive - How to make, design and build a responsive blogger template. This is an advanced tutorial & tep-by-step guide for making mobile-friendly responsive blogger HTML template compared to responsive web development. [Read More...]
These are the best android and iOS apps you need to consider and install right after buying a new smartphone to make your life easier. These apps will keep you smartphone as like new and boost mobile performance regularly. [Read More...]