Hi,

I cannot make Google Plus button visible in my tests on local machine. Do I miss anything in code below?

Thanks

<html>
  <head>
    <title>+1 demo: Basic page</title>
    <link rel="canonical" href="http://www.example.com" />
	<!-- Place this render call where appropriate -->
	<script type="text/javascript">
	  window.___gcfg = {lang: 'en-GB'};

	  (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>	
  </head>
  <body>
	<!-- Place this tag where you want the +1 button to render -->
	<g:plusone size="medium"></g:plusone>
  </body>
</html>

Recommended Answers

If this is executed locally, without a webserver, then the remote Javascript file will not be executed for security reasons.

If you are running WampServer or XAMPP (assuming Windows) locally, then it should work.

Jump to Post

All 2 Replies

If this is executed locally, without a webserver, then the remote Javascript file will not be executed for security reasons.

If you are running WampServer or XAMPP (assuming Windows) locally, then it should work.

Thanks it works now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.