Status
Not open for further replies.

Mr Happy

Active Member
4,093
2009
2,572
0
Google have updated their code to the +1 button. Everyone (including WJ) should update to the new code as it's far faster.

http://www.google.com/webmasters/+1/button/

In WJ (or other sites where you have the button) you need to change:
PHP:
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
to this
PHP:
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
 
17 comments
Do you find any improvement after adding the +1 code in your website?

Yes I do. In technical terms this is what the new code does. When you download a webpage you have to download images, JavaScript, CSS and the page itself. Your browser downloads all these at the same time. The problem with all JavaScript is it stops the downloading of everything else until it's finished downloading. This is one of the reasons they suggest to have JavaScript at the bottom of the page.

This new code, as well as being better coded, is clever in that it doesn't stop the loading of other elements so they can be downloaded in parallel.
 
Major Bump

I know WJ has a few versions of the same theme each with minor revisions. This current version WJunction 2.2 Style ID: 14 doesn't have this added while the older version does. Can you add this to the current version of this theme too?


As for everyone else double check your using the current version to make sure it's as fast as possible for your visitors.
If you click on Advanced Options on the Google +1 Button Page you also have the option to make it html 5 valid.
 
Status
Not open for further replies.
Back
Top