【发布时间】:2011-05-19 10:42:38
【问题描述】:
我对 JavaScript 和 Facebook SDK 完全陌生。有人可以用英语描述以下功能吗:
window.fbAsyncInit = function() {
FB.init({appId: 'your app id', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
即用英语“阅读”这个的标准方式。 “(function(){”位是我摔倒的地方。我可以看到它在做什么:运行这个位之后,异步继续并在function()中执行这些东西,但是这是什么JavaScript功能以及组件是什么?
【问题讨论】:
标签: javascript facebook