我在jboss-web.deployer \ ROOT.war中创建了一个名为test.html的测试页。
我添加了像按钮和OG元标记的Facebook。当我点击喜欢时,标题和描述不会在Facebook上分享。当我点击按钮时,即使我无法看到弹出窗口。请帮帮....
请在下面找到代码:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description"
content="A group of U.S. Marines, under command of
a renegade general, take over Alcatraz and
threaten San Francisco Bay with biological
weapons."/>
</head>
<body>
<!-- AddThis Button BEGIN -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:like href="href="http://157.241.56.242:8080/Test5.html" width="450" height="80"/>
<!-- AddThis Button END -->
</body>
</html>
答案 0 :(得分:0)
您不需要添加XML命名空间,而是添加前缀。以下是来自http://ogp.me/的令牌:
<html prefix="og: http://ogp.me/ns#">