vjnan369
vjnan369

Reputation: 853

Unable to embed google plus posts

I am trying to embed google plus posts in my application. I have loaded platform.js file in header

<script>
  window.___gcfg = {
    lang: 'en-US',
    parsetags: 'onload'
  };
</script>
<script src="https://apis.google.com/js/platform.js" async defer>
</script>
<script>
  function renderWidget() {
    gapi.post.render("widget-div", {'href' : 'https://plus.google.com/109813896768294978296/posts/hdbPtrsqMXQ'} );
  }
</script>   

In html page

<a href="#" onClick="renderWidget();">Render the embedded post</a>
<div id="widget-div"></div>

When I clicked on the link, it shows nothing. Is there anything to be added. Here is the reference i followed https://developers.google.com/+/web/embedded-post

Upvotes: 0

Views: 241

Answers (1)

Ravi Prakash Verma
Ravi Prakash Verma

Reputation: 1484

You might be opening HTML file directly in browser, which could be problem in some browser(s) (i.e. In Google Chrome. You can verify the issue here).

Try running it using a local-server(XAMPP maybe) so the URL will look similar to http://localhost/yourpath/test.html

Hope this helps!!

Upvotes: 1

Related Questions