javascript - Google+ 参数无法正常工作

标签 javascript html schema google-plus facebook-opengraph

我正在尝试让 Google+ 共享链接在个性化内容旁边显示图像,但这对我来说实际上不起作用,而且让我发疯;这应该是一项基本任务。

我在 Google+ 上使用了丰富网页摘要生成器,该生成器生成了一些元标记,但我的共享链接未获取任何数据。

我做错了什么?它没有显示我在 Google+ 共享链接中链接的说明或图像。

谢谢

<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">

<!-- Add the following three tags inside head. -->
<meta itemprop="name" content="Tamar">
<meta itemprop="description" content="dioshiofdhwai">
<img itemprop="image" src="www.onthisdayindigital.com/image1.png" />

<head>
<title>Tamar SEO, Social & Mobile | OnThisDayInDigital</title>
<link rel="stylesheet" type="text/css" href="design.css" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> 
<link href="/icon.gif" type="image/ico" rel="icon">
<link rel="image_src" href="/icon.gif" />
    <!-- Place this tag where you want the share button to render. -->
<div class="g-plus" data-action="share"></div>

<!-- Place this tag after the last share tag. -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/platform.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
</head>
</html>

最佳答案

我不确定这就是问题所在,但我想指出的是,您没有按照评论所说的那样将它们放入 head 标记中。您将其放在标签之前。

尝试将其移动到标记内,看看它是否有效。

关于javascript - Google+ 参数无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21453798/

相关文章:

html - CSS - 文本背景

Java - 有没有一种方法可以在不迭代的情况下查询 Apache Spark 模式?

javascript - 在 jquery 自动完成控件上按 escape

javascript - 我什么时候应该使用 `this.x` 与 `var x` ?

html - 将元素居中并排放置

node.js - 将字段添加到从 Mongoose 模式派生的模型中

c# - 确定是否从模式生成 ExecuteNonQuery 或 ExecuteReader

javascript - Angular2 是否内置了 jQuery?

javascript - 数组原型(prototype)和文字

html - :hover background replacement on a empty a tag not working