异步或同步加载更好?

时间:2012-01-14 17:01:13

标签: facebook asynchronous facebook-javascript-sdk

在JavaScript SDK上找到 http://developers.facebook.com/docs/reference/javascript/

    "...
    Asynchronous Loading
    --------------------------------
    This code loads the SDK asynchronously so it does not block loading other
 elements of your page. This is particularly important to **ensure fast page 
loads for users and SEO robots**.

    Synchronous Loading
    --------------------------------
    It is possible to load the SDK synchronously which may be useful for 
debugging, but this method is not recommended for typical use. Synchronous
operations will block the web page, resulting in worse performance and a 
slower user experience. This **may also negatively impact SEO due to the 
increased slowness perceived by robots and crawler**s. ..."

那么,这些陈述中的哪一个是正确的?

1 个答案:

答案 0 :(得分:0)

两者都是。

对于调试同步很好。

对于生产代码,异步更好。