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

Discussion in 'XenForo Suggestions' started by rellek, Aug 1, 2013.

  1. rellek

    rellek Well-Known Member


    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.
    Andy.N, pjfry, Code Monkey and 13 others like this.
  2. sonnb

    sonnb Well-Known Member

    It also makes an issue that you have to press Back button several times to navigate to previous page as it counts the frame load is one load times.
    Adam Howard, 0xym0r0n and rellek like this.
  3. karll

    karll Well-Known Member

    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.)
    D.O.A. and Adam Howard like this.
  4. aiman.h.kallaf

    aiman.h.kallaf Active Member

    Strongly Agree
    my shared host is already slow as it is
    Adam Howard likes this.
  5. silence

    silence Well-Known Member

    Absolutely it happens with both the Facebook and Twitter buttons. I have also disabled them.
    Adam Howard likes this.
  6. Rob

    Rob Well-Known Member

    I've seen this be a major problem too
    Adam Howard likes this.
  7. Triops

    Triops Active Member

    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:

    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: Aug 20, 2013
    HWS, Adam Howard and karll like this.
  8. Adam Howard

    Adam Howard Well-Known Member

    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.
  9. rellek

    rellek Well-Known Member

    @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 likes this.
  10. Adam Howard

    Adam Howard Well-Known Member

    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.
  11. rellek

    rellek Well-Known Member

    I'm sorry, I don't get it. What's the difference between your suggestion and what heise online implemented? Look here:

    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.
  12. Triops

    Triops Active Member

    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.
  13. wmtech

    wmtech Well-Known Member

    Andrej and karll like this.

Share This Page