Google plus one button not showing

Jon Cox picture Jon Cox · Jul 18, 2011 · Viewed 15.7k times · Source

I'm trying to add a Google +1 button to my website.

I have followed the instructions here: http://www.google.com/intl/en/webmasters/+1/button/index.html

This the code for my webpage:

<html> 
    <head> 
        <title>
            Why won't it appear?
        </title>
        <!-- Place this tag in your head or just before your close body tag -->
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
    </head> 
    <body> 
        <h1>
            Example title
        </h1>
        <!-- Place this tag where you want the +1 button to render -->
        <g:plusone size="tall" href="http://www.example.com/"></g:plusone>
    </body> 
</html> 

As you can see, I've followed their instructions exactly, and yet it does not appear. I've tried it on Chrome, Firefox and IE8 (all on Windows XP). I'm just opening the webpage from my local system.

Interestingly I can see it working here http://www.satinbow.co.uk/xxtest.html


Can anyone solve the mystery?


Update / clues

When the page is stored on my system locally, it doesn't work (hard refreshing didn't fix it either.)

But I've put the page here: dl.dropbox.com/u/6920023/test2.html and it seems to work there.

It would be really cool know what's going on :)

Answer

ysrb picture ysrb · Jul 18, 2011

I think it's because when it's local (not webserver) browser block the JS script (that's hosted externally) to prevent security breach. That's why it doesn't work

Link: http://ejohn.org/blog/tightened-local-file-security/