admin管理员组文章数量:1323157
I noticed an empty ment block in JSONP output returned by facebook graph api for all methods.
URL that I called :
;callback=theGreatFunction
The JSONP output is :
/**/ theGreatFunction({
"data": [
{
"name": "First Friend",
"id": "XXXX"
},
{
"name": "Second Friend",
"id": "XXXXXX"
},
........
My question is : What does the empty ment block /* */
before the callback function signify ?
Does it have a peculiar purpose ? Does it fix any known javascript gotcha ?
I noticed an empty ment block in JSONP output returned by facebook graph api for all methods.
URL that I called :
https://graph.facebook./NUMERIC_FACEBOOK_ID/friends?access_token=ACCESS_TOKEN_STRING&callback=theGreatFunction
The JSONP output is :
/**/ theGreatFunction({
"data": [
{
"name": "First Friend",
"id": "XXXX"
},
{
"name": "Second Friend",
"id": "XXXXXX"
},
........
My question is : What does the empty ment block /* */
before the callback function signify ?
Does it have a peculiar purpose ? Does it fix any known javascript gotcha ?
2 Answers
Reset to default 15We added this to protect against an attack where a third party site bypasses the content-type of the response by doing:
<object type="application/x-shockwave-flash"
data="http://graph.facebook.?callback=[specifically crafted flash bytes]">
</object>
Google does something similar, except they use //... + \n (e.g. http://www.google./calendar/feeds/[email protected]/public/full?alt=json&callback=foo)
Could be some kind of seperator to have a fixed start. I guess Facebook had a reason to but it there but we can only guess and it does not really matter does it? :)
本文标签:
版权声明:本文标题:javascript - Facebook graph api JSONP format , what does the * * in first line signify? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742142280a2422633.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论