News for hackers. Stuff that matters.
Re:Tell HN: Your social widgets are losing you visitors righ... by cont4gious on Friday October 08, 2010 @11:33AM (#1771979)
Did I miss something, or why are these in your head tag? Why not put them in the body tag so they don't load until after the browser has rendered the page?
Re:Tell HN: Your social widgets are losing you visitors righ... by rarestblog on Friday October 08, 2010 @11:47AM (#1772033)
Sorry, but you aren't right. Those are mostly located in body tag. They are requested as soon as encountered by browser, because they might issue "document.write", so the execution of rest of HTML is delayed until that "src" is loaded. That's exactly what causes the problem. Putting script into body doesn't defer its execution.

I'm not sure how browsers render <script src in head, but probably the same.

Re:Tell HN: Your social widgets are losing you visitors righ... by briancray on Friday October 08, 2010 @12:08PM (#1772104)
Works same in the head. All scripts if not set to asynchronous will prevent further rendering of the page until the script has finished loading and running.
Re:Tell HN: Your social widgets are losing you visitors righ... by cont4gious on Friday October 08, 2010 @11:49AM (#1772044)
oh, ok, thanks! i would have made the assumption that this would have fixed it and been frustrated.
Re:Tell HN: Your social widgets are losing you visitors righ... by jasondavies on Friday October 08, 2010 @11:37AM (#1771996)
Good point, but you'll still benefit from using async script loading if you have multiple third-party scripts loading at the end of your page. If the Twitter script is included before the others, and it lags, it will hold them up too.