与Google +分享动态内容图片javascript
Google plus share with dynamic content image javascript
我需要从我的网站发布评论到google +。我用了一个脚本,它的工作很好文本。但是我还想显示图像
我使用了以下代码:-
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'http://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
var cid = 'My console developer id .apps.googleusercontent.com';
var options = {
contenturl: 'http://www.google.com',
contentdeeplinkid: '/pages',
clientid: cid,
cookiepolicy: 'single_host_origin',
prefilltext: 'Hai happy friday<img src="fgdhj"/>',
calltoactionurl: 'http://www.google.com'
};
// Call the render method when appropriate within your app to display
// the button.
gapi.interactivepost.render('sharePost', options);
如何显示图像?请帮帮我。
可以预填充文本,而不是HTML。您可以将图像插入任何Google+帖子的评论字段,无论是否编程。您可以链接到具有嵌入图像的页面,并且可以为该页面设置schema.org微数据,以建议使用特定的图像。
相关文章:
- 如何使Javascript动态html表及其上的事件
- 使用JavaScript动态插入DIV的成本有多高
- Javascript动态变量(添加了随机数)
- JavaScript-动态SVG-onload属性-未触发事件
- 传递给 PHP 表单时 JavaScript 动态变量上的未定义索引
- 如何在没有ajax的情况下将javascript动态数据发送到php变量
- 使用javascript动态创建html内容/元素
- 带有多个答案选项的Javascript动态数组窗口
- JavaScript:动态扩展原型是一种糟糕的做法
- Javascript+动态菜单+当前链接样式(CSS)+基于PHP的网站
- javascript动态内容与选择长运行脚本
- Javascript:动态更改CSS文件+Cookie
- 使用javascript动态计算top属性
- 使用javascript动态选择幻灯片放映的图像
- 如何访问用javascript动态生成的textarea的文本内容
- Javascript动态表,每个单元格都有一个onmouse事件
- Php,Javascript-动态表单id's和动态验证
- JavaScript动态附加到搜索字段
- 如何将CSRF令牌添加到javascript动态生成的表单中
- 从Javascript动态构建JSON对象列表