• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Load Facebook et al. at the end using AJAX

rellek

Well-known member
#1
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.
 

karll

Well-known member
#3
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.)
 

Triops

Active member
#7
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:

Adam Howard

Well-known member
#8
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.
 

rellek

Well-known member
#9
@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

Well-known member
#10
@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.
 

rellek

Well-known member
#11
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.
 

Triops

Active member
#12
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.