Facebook 点赞和分享信息未正确显示
我制作了我的网站我的短信好友,并且我添加了一个类似 facebook 的按钮来在 facebook 上分享我的网站。但是,每当我点击“赞”按钮时,它只显示我的网站网址,但不显示缩略图、标题、描述,尽管我已经为主页内的所有信息编写了代码。这是主页的示例代码
<head>
<meta property="og:title" content="My SMS Buddy" />
<meta property="og:type" content="activity" />
<meta property="og:url" content="http://www.eravikant.com" />
<meta property="og:image" content="http://www.eravikant.com/images/image.jpg" />
<meta property="og:site_name" content="My SMS Buddy" />
<meta property="fb:admins" content="100002723853376" />
<meta property="og:description" content="Share and Send Free Sms Anywhere In India Which Support Upto 160 Characters Long Sms Without Any Advertisements Attached with the Sms To Any Mobile In India With Easy Group Messaging" />
</head>
<body>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.eravikant.com&send=false&layout=box_count&width=60&show_faces=true&action=like&colorscheme=light&font=segoe+ui&height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:60px; height:90px;" allowTransparency="true"></iframe>
</body>
需要建议,这里做错了什么...... 建议将不胜感激...
I made my website My SMS Buddy and i have included one facebook like button to sharing my website on facebook. But, whenever i clicked on the like button, it is only showing my website url,but it is not showing thumbnail,title,description, although i have written the code for all the information inside the main page. This is the sample code of the main page
<head>
<meta property="og:title" content="My SMS Buddy" />
<meta property="og:type" content="activity" />
<meta property="og:url" content="http://www.eravikant.com" />
<meta property="og:image" content="http://www.eravikant.com/images/image.jpg" />
<meta property="og:site_name" content="My SMS Buddy" />
<meta property="fb:admins" content="100002723853376" />
<meta property="og:description" content="Share and Send Free Sms Anywhere In India Which Support Upto 160 Characters Long Sms Without Any Advertisements Attached with the Sms To Any Mobile In India With Easy Group Messaging" />
</head>
<body>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.eravikant.com&send=false&layout=box_count&width=60&show_faces=true&action=like&colorscheme=light&font=segoe+ui&height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:60px; height:90px;" allowTransparency="true"></iframe>
</body>
Need suggestion, what am doing wrong here...
Suggestion will be appreciated ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的页面的 HTML 中有一些非常奇怪的东西。您有重复的开始和结束 HEAD、BODY 以及包装 HTML 标记。这是无效的 HTML,根本无法解析。这也不会在网络浏览器中正确显示您的页面,因为它不知道要呈现 HTML 的哪一部分。这就是Facebook令人困惑的地方。
删除第一个 HTML 开头和结尾(及其内容),Facebook 应该可以正常获取您的 OG 元数据。它位于第二个 HTML HEAD 元数据中,看起来不错。
There are some really odd things in your page's HTML. You have duplicates of your opening and closing HEAD, BODY and wrapping HTML tags. This is invalid HTML and doesn't parse at all. This also won't show your page properly in web browsers since it won't know which part of the HTML to render. This is what is confusing Facebook.
Remove the first HTML opening and closing (plus its contents) and Facebook should get your OG Metadata fine. It's in the second HTML HEAD metadata and that looks fine.