Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:32+00:00 2026-05-27T14:42:32+00:00

I have seen facebook javascript api mentioning that loading the sdk asynchronously // Load

  • 0

I have seen facebook javascript api mentioning that loading the sdk asynchronously

// Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));

what is the difference in loading a script using the script tag directly like the following

<script src='as.js'></script>

and the above shown code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:42:33+00:00Added an answer on May 27, 2026 at 2:42 pm

    The <script> tag loads the javascript synchronous in a guaranteed order. The script will load before other things that follow it (other scripts or other elements of the page).

    The first option in your code example loads it asynchronously with no predictable order relative to the other things on your page.

    Asynchronous loading has the advantage that nothing in the page waits for the script to load and the page can render before the script finishes loading. Asynchronous loading has the disadvantage that you can only know when it’s loaded and available for use if you either monitor a load event for that script or if it calls you when it loads and runs or if you poll for some artifact that it makes available when it runs.

    Synchronous loading (using <script> tags has the advantage that scripts load in a predictable order so you can load library scripts first and then scripts that use those libraries and know that they will be loaded in the desired order without any special coding. Synchronous loading of a script that occurs before all the body content can significantly slow down the rendering of the content that follows it because the script has to both load and execute before the rest of the page can be loaded and rendered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen a lot of questions here regarding the Facebook Graph API but
I have seen in many websites, that they uses facebook login button, yahoo login
I have seen online php mmo's and Facebook games that have a timer when
I have not seen much support for Grails to develop facebook apps.I was just
I have an application that integrates with Facebook using Oauth 2. I can authorize
Dont know what to call it, but if you have seen on Facebook, when
I have a facebook app that is displaying random quotes - it is written
I want to implement Facebook Connect in my android application. I have seen a
Have you seen an implementation of Facebook Share where the confirmation appears not in
I have seen scripts that have a menu fixed to the top of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.