2016-11-09 5 views
0

私は自分のアプリケーションにgoogleプラス投稿を埋め込んでいます。 私がリンクをクリックしたとき、私はhtmlページGoogleプラス投稿を埋め込むことができません

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

では、ヘッダ

<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> 

platform.jsファイルをロードしている、それは何も表示されません。追加するものはありますか?ここに参考文献がありますhttps://developers.google.com/+/web/embedded-post

+0

この[jsfiddle](https://jsfiddle.net/rmvv67wy/)ではうまくいきました。 – abraham

答えて

1

HTMLファイルをブラウザで直接開くことができます(ブラウザによっては問題が発生する可能性があります(here)。

は(多分XAMPP)ローカル・サーバーを使用してそれを実行してみてくださいのでURLhttp://localhost/yourpath/test.html

・ホープ、このことができますようになります!

関連する問題