【发布时间】:2016-05-25 13:35:43
【问题描述】:
我只是尝试使用 facebook 上的链接加载我的 html,但它不会正确呈现我的 html。它只呈现元图标签,下面的 facebook 提到了这一点
<meta property="og:title" content="HyperArts SEO Services" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://www.hyperarts.com/_img-fb/Image-SRC_HyperArts.png" />
<meta property="og:image" content="http://www.hyperarts.com/_img-fb/Image-SRC_HyperArts_blue.png" />
<meta property="og:url" content="http://www.hyperarts.com/seo-services/search-engine-optimization-services-san-francisco.html" />
<meta property="og:site_name" content="HyperArts Web Design & Social Media" /><!--formatted---
我的html是
<!doctype html>
<html ng-app="myapp" xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/din-Regular.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="" />
<meta property="og:title" content="myapp" />
<title>myapp</title>
</head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.min.js"></script>
<script src="app.js"></script>
<script src="profileController.js"></script>
<body>
<div class="wraper"></div>
<div class="box">
<div class="profile-box-row clearfix">
<div class="user-profile left">
<div class="imgb">
<div class="imgb-in">
<img src="images/img_man.jpg" alt="img">
</div>
</div>
<span class="user-name">Akshay</span>
</div>
<div class="txtb">
<span class="percent">80%</span>
<p>common interests in myapp</p>
</div>
<div class="user-profile right">
<div class="imgb">
<div class="imgb-in">
<img src="images/img_girl.jpg" alt="img">
</div>
</div>
<span class="user-name">Pratiksha</span>
</div>
</div>
<div class="botom-text">
<p>See who tops to match your preferences among friends. Download Samepinchh http: //<a href="www.myapp.com" target="_blank">www.myapp.com</a>
</p>
</div>
</div>
</body>
</html>
它不会在body标签内渲染任何东西,只在head标签中显示标题和图像。
下面是我用于共享 html 链接的控制器。
我的控制器
public void shareMatchingOnFb(final User user, final Long friendId, final String fbAccessToken) {
FacebookClient facebookClient = new DefaultFacebookClient(fbAccessToken);
InputStream is;
FacebookType publishPhotoResponse = facebookClient.publish("me/feed", FacebookType.class, Parameter.with("message",
"Testing"),Parameter.with("link",
"http://example.com/122222/1222212"));
}
请帮助我在那里做错了什么,我已经花了一天时间。
谢谢
【问题讨论】:
-
那么,为什么不将提到的元标记添加到页面头部?
-
我提到了标题标签,它正在显示。但是在body标签里面,它没有渲染任何东西,我要求这个。
-
它不应该在正文标签中呈现任何内容。这是 META 内容
标签: javascript html facebook