[JavaScript] Lazy Load Facebook Like Box To Speed up Page Load Time | Website Performance Monitoring

How to lazy load Facebook like button on the scroll after the page loaded using Jquery? Make Facebook likebox asynchronous to loaded automatically on the scroll. Learn how to lazy load scroll down jquery script files to improve page speed. Here on the problogbooster. I still use the method to asynchronous lazy-load other types of scripts, there is no need of javascript gettime to call it to run.
Lazy load Facebook's likebox
I today demonstrate you Facebook lazy loading likebox for your site and auto load content on scroll down, so stop searching to defer lazy loading of Facebook widgets to speed up page loading. The Facebook likebox 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 likebox button and follows all the rules by Facebook page developer. This technique also lazy load the Facebook content placeholder css while you scroll the pages. The widget code and jquery lazy load content on the scroll.

There is special like box WordPress plugins for the custom like button facebook widget that load content while scrolling with jquery. But what about the blogger users? What if the facebook app not loading faster as page load? This tutorial answers for blogger and Facebook widget WordPress code as well to use jquery on the scroll for differ loading of Facebook like fan page by using jquery ajax load javascript. Here I have provided the direct code of widget for Facebook page likebox as a Facebook like page plugin. I suggest you use it with your website not only for faster page loading but for better Facebook marketing. Learn how to add Facebook to the 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 button script uses the browser's lazy-loading mechanism by setting the loading=lazy iframe attribute. The effect is that the browser does not render the plugin if it's not close to the viewport and might never be seen.
Lazy load Facebook Like button script uses the browser's lazy-loading mechanism by setting the loading="lazy" iframe attribute. The effect is that the browser does not render the plugin if it's not close to the viewport and might never be seen.
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

Lazy load Facebook like button script uses the browser's lazy-loading mechanism by setting the loading="lazy" iframe attribute. The effect is that the browser does not render the plugin if it's not close to the viewport and might never be seen.
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:

RECOMMENDED: [Facebook Security Alert] Use 3 Passwords To Access Facebook Account // FB Update
<!-- 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>
You just need to replace ID and width=300 text as per your content.

A demo is working here on this site, or you can check its performance on Page Speed and Pingdom Page Speed, significantly you will see the changes in the report.


If you enjoyed this article, please share it with your friends and help us spread the word.

Next Post Previous Post
1 Comments
  • Harman ਸਿੰਘ Hira
    Harman ਸਿੰਘ Hira August 6, 2013 at 3:32 AM

    Thanks for all this new and working technique!

Add Comment
comment url
But before you read the page, I just want to tell you that; you can now convert every visitor & every impression in $$$ with the most advanced & reliable monetization platform that having highest fill rate & the best payouts in the industry.
ADTR Network

One day approval. Monetize your traffic from day 1, with 100% fill rates, higher CPM, & quick payouts. Register to Start Earning Right Now →

Join
ADTR Network
Now

New AI-Powered Content Marketing Toolkit
Rated 5/5 stars in 10,000+ reviews. Stay ahead of the competition with next-gen tech adoption by optimizing content for the target audience to drive 3x faster results. Act now to gain a competitive edge in the market.

ADTR

Improve Revenue, Performance,
&
Grow Traffic Faster

Join Adsense Certified Ad Partner
"ADTR is a must have automatic testing tool for serious publishers."
300% Rise
in AdSense Earnings
Get results from Day 1
It's FREE
Read The Case Study

Testimonials

Client Name 1

I joined PBB when I started blogging 6 years ago. It was my go-to resource for just about ANYTHING!! Without it, I would not have continued down this journey. Having the support, motivation and resources available when you’re in such a lonely profession like blogging is crucial to success. Thank you PBB for helping me turn my passion into a full-time career!!!.

Nikhil Agarwal
Client Name 2

Thank you! After many years of dreaming and enjoying the beauty and insight from numerous blogs I found the courage to start one myself. I could not have done it with your step-by-step guidance! Thank you so much for Pro Blog Booster, for your patient instructions, and for your nudge to publish before it is perfect! I have a long way to go, but am excited to be tippy-toeing into the blog world!

Nandhini Sinha
Client Name 3

I highly recommend ProBlogBooster to any new tech blogger. I began my journey several years ago. The site holds a wealth of information and is both inspiring and educational. They keep up-to-date with the latest standards and trends bringing key information to help you start and grow your technology blogging business. The tech tuts are very in details and the support you receive will help to overcome any challenges along the way. Again, I highly recommend PROBLOGBOOSTER as your companion for tech blogging!

Arnab Tamada
Client Name 4

Problogbooster is awesome. If you’re serious about taking your blog to the next level then there’s no better blog. It has given me the confidence to keep growing my eCommerce site and view it as a serious business.

Matt Flynn

Disclaimer

We are a professional review site that operates like any other website on the internet. We value our readers' trust and are confident in the information we provide. The post may contain some affiliate/referral links, and if you make a purchase through them, we receive referral income as a commission. We are unbiased and do not accept fixed marketing articles or fake reviews. We thoroughly test each product and only give high marks to the very best. We are an independent organization and the opinions/views/thoughts expressed here are our own.

Privacy Policy

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