Not planned Load Facebook et al. at the end using AJAX

rellek

Well-known member
Hi,

I'd like to suggest loading those Facebook, Twitter and Google scripts at the end, maybe using AJAX. It's quite often lately that connect.facebook.com doesn't respond so your site is loading and loading and loading and sometimes not even stuff like your header image is loaded.

So loading those scripts when everything else is done would 'fix' that, I think.
 
Upvote 16
This suggestion has been closed. Votes are no longer accepted.
Yes, at least something should be done about it.

Personally, I've disabled the Facebook "recommend/like" button because it's so slow that it makes my site look bad. (A secondary reason I disabled it is that Facebook is evil.)
 
Support it!
I would even prefer to have a 2-clicks solution implemented, since in some countries, for example Germay, a lot of people don't like/trust Facebook and moreover there might be a legal privacy protection issue if you activate facebook per default without opt in:
http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html
http://www.heise.de/extras/socialshareprivacy/

So, with 2-clicks there will be never a connecting and legal issue when loading forums index or threads, because although Facebook/Twitter/Google+ is clearly visible to the users, its activated after the first click only - as an opt in on every page.
 
Last edited:
I'd take this even further and suggest the photo be a static image (not dependent on Facebook's servers) & that the actual script not be loaded unless someone clicks on that button.

I've seen this done on a few site & it surely does improve the overall load & management.
 
@Adam Howard
Yeah, this is basically what @PyroM meant. Heise online (see his links) "invented" this because we have some really crazy guys who do the privacy protection in Germany. And this solution (image from the own webspace and after the click the real script is loaded) seems to comply with the privacy protection law.
 
@Adam Howard
Yeah, this is basically what @PyroM meant. Heise online (see his links) "invented" this because we have some really crazy guys who do the privacy protection in Germany. And this solution (image from the own webspace and after the click the real script is loaded) seems to comply with the privacy protection law.
Not a fan of the two click system, so not exactly what I was talking about.

Take my words for face value.... Social media buttons as static content (images) and nothing loaded until you click on them.
 
Not a fan of the two click system, so not exactly what I was talking about.

Take my words for face value.... Social media buttons as static content (images) and nothing loaded until you click on them.
I'm sorry, I don't get it. What's the difference between your suggestion and what heise online implemented? Look here:
http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html

It's at the end of the article above "Kommentare lesen (184 Beiträge)". You have to click the Facebook thing (which is an image hosted at heise.de) and this loads the actual facebook script from facebook.com.
 
And there is no problem to change the code a little to have the static images on your own server, if you prefer.
Facebook, or Twitter, or Google+ scripts are then only loaded from the foreign servers, when the appropriate static is clicked.
 
We no longer use the native share buttons from various services and this approach has zero JS overhead on load and allows us to support many more share links.

As such, this is no longer needed.
 
Back
Top Bottom