- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为我的 iframe Canvas 应用程序异步加载 JavaScript SDK。
我知道 fbml 已被弃用并被逐步淘汰,但 xfbml 还可以吗?
我还能使用 fb:name 例如。 <fb:name uid="2901279">
?
例如,有没有更好的方法来为用户打印 100 个 friend 的名字?
最佳答案
您需要开始使用图谱 API,这里有一个快速工作示例来帮助您入门:
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Facebook Javascript SDK</title>
</head>
<body>
<div><fb:login-button perms=""></fb:login-button></div>
<div id="friends"></div>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'APP_ID',
cookie : true,
status : true,
xfbml : true
});
FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
FB.api('/me/friends',function(resp) {
if(resp && resp.data.length) {
var html = '<ul>';
for(var i=0; i<resp.data.length; i++) {
html += '<li><img src="http://graph.facebook.com/' + resp.data[i].id + '/picture?type=small" />' + resp.data[i].name + '</li>';
}
html += '</ul>';
document.getElementById('friends').innerHTML = html;
}
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
</body>
</html>
只需替换为您的应用程序 ID,您就可以开始了!
关于javascript - 如何在 Facebook 中使用他们的 uid 显示用户的姓名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6005202/
我正在使用 ajax 实时搜索来选择名称和姓氏的串联与输入的文本匹配的所有用户,并且效果很好: $sql = "SELECT * FROM users WHERE concat(name,' ',su
我尝试建立一个注册表单。该注册表单为名为“address1”的文本框,其附近有一个名为“Add Address”的按钮。该按钮的功能 - 添加更多地址的文本框。先前地址框附近的按钮更改为“删除”,从而
我一直在尝试制作一个验证电话号码和姓名的表单,但无论何时输入提交,无论字段是否填写,它都只会输入相同的消息。消息不断出现,我想不通 预计到达时间:http://jsfiddle.net/6W3uU/
我正在寻找验证 上的姓名和电子邮件输入的代码 我希望用户名只有 A-Z , a-z并且必须有一个下划线 _ , 电子邮件应该有一个 @ .我怎样才能用 jQuery 做到这一点? 表格(示例):
我在db中有一个带有id,name和parent的部门表.parent是与父root对应的id。现在我已经显示了id(父id),但是我想显示与之对应的部门的名称我已经在Departmentcontro
我正在尝试显示平均分最高的 worker 的姓名。我的第一个表是 worker 表并存储 worker_id 和 worker_name。第二张表是测试表,存储了参加测试的worker_id、test
用什么方法或变量可以找到本例中父对象的名称?也就是说,当鼠标悬停在第一个按钮上时,获取名称 $GetParentName = "Button01",第二个 $GetParentName = "Butt
我有一个数据库,其中一个表中有父名称。列:id、名称。以及其他表中的id、parent_id、name。在搜索字段中我输入名称。更不用说鲍勃、爱丽丝和汤姆了。我必须在数据库中搜索 child 名为鲍勃
我有以下查询: SELECT ty.id, ty.type, ty.pid, if(ty.pid = 0, '-', (select ty.type from bid_type ty w
我有一个如下所示的数据库: CREATE TABLE Persons ( id int, parentID int, name varchar(255) ); INSERT I
我无法获得预期的结果我希望我的程序显示任何人都可以帮助我。该程序用于打印结构中列出的 worker 姓名,如果您不输入任何这些姓名,我应该打印不存在的 worker 姓名。有人可以告诉我要使用的代码/
我正在读取 JSON 对象并以表格格式名称和文本在 html 中显示它们,但无法使用 javascript 获取节点的父名称 { "A": { "B": "Text",
当用户在我的 iPad 报亭应用上购买杂志订阅时,他们会收到分享一些信息的提示: 分享您的信息? [此处的应用名称] 的发布者希望根据他们的隐私政策使用您的姓名、电子邮件和邮政编码。 但是,我似乎无法
我有一大堆电子邮件,需要从中提取信息。我最近接手了一个网站,该网站将客户的所有联系信息存储在电子邮件中。他们想要开始将其存储在数据库中。我正在使用 Java 来尝试提取这些信息。我有点陷入困境。 我能
我有一个使用 qbXml 和 Intuit Web 连接器与 QuickBooks 同步的应用程序。 我在查询帐户时注意到一些异常行为。根据规范,一个帐户的全名应该包括它的任何祖先的名字,用冒号分隔。
下面是一个更大的数据框的示例。 Fare Cabin Pclass Ticket Name 257 86.5000 B77 1 110152
我在我的 Program.cs 文件中有一个方法要实现。当该方法遍历作业列表(其中每个作业都是一个字典)时,它应该打印: ***** name: Data Scientist / Business I
如何从包含三列的表格中查找第二高薪水,这些列是id、name、 salary,但在SELF JOIN中使用。通过嵌套查询得到答案。但是,我想知道我们如何使用 SELF JOIN 构建框架 最佳答案 如
我想在 WooCommerce 中运行 SQL 查询来选择所有没有订单、姓名、实际地址和电话号码的用户。我已经运行了以下代码,但它对我不起作用。 SELECT * FROM wp_usermeta
给定(例如): Dog breeds (Name) | id Labrador Retriever | A1 German Shepherd | A2 Golden Retriever |
我是一名优秀的程序员,十分优秀!