简体   繁体   English

如何从Facebook JSON获取ID值?

[英]How do I get the ID value from facebook JSON?

basically, I have input where you type the facebook user ID and and then the script fetches its value to get the link to facebook graph like: 基本上,我在您输入facebook用户ID的地方输入内容,然后脚本获取其值以获取指向facebook图的链接,例如:

var faceuserID = document.getElementById('userID').value;
$.getJSON('http://graph.facebook.com/' + faceuserID, function(data) {

}

Then I can get the link to the facebook graph which returns the JSON array. 然后,我可以获得指向返回JSON数组的facebook图的链接。 However I need only the ID value to some new variable. 但是,我只需要一些新变量的ID值即可。 How do I get it? 我如何得到它?

You have to you attr(jquery) . 您必须拥有attr(jquery) ID is attribute, not a value. ID是属性,而不是值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM