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 7511457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:33:08+00:00 2026-05-29T23:33:08+00:00

The official way of loading the SDK, suggested by FB’s documentation, is this: <script>(function(d,

  • 0

The “official” way of loading the SDK, suggested by FB’s documentation, is this:

<script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=APP_ID";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

However, I’ve already seen it done like this:

<script src="http://connect.facebook.net/en_US/all.js"></script>
...
FB.init(APP_ID, true, true, true);

What’s the difference (in practice) between those two?

I’m writing a GWT application that uses social plugins. What would be the best way to load it?

  • 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-29T23:33:09+00:00Added an answer on May 29, 2026 at 11:33 pm

    I’ve not worked directly with the facebook api, though I’ve written lots of GWT, integrated with page-level JavaScript

    Take a look at the ScriptInjector class – one method lets you inject a string, the other lets you injects a script from url and get a callback when it is loaded.

    Another thought: JSNI allows you to call javascript from within your Java app. If you can include that script tag on page load, you could call that FB.init from a Java method:

    private native void nativeFbInit(String appId) /*-{
        $wnd.FB.init(appId, true, true, true);
    }-*/;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the official way is the registry, but this is kinda timeconsuming. I
Is there a more official way to force a phpunit failure than $this->assertTrue(false) ?
In PHP, I know there is no official way to delete items once they
The official oauth guide makes this recommendation: It is important not to try and
Beyond the official documentation, are there any recommended resources for learning to build jQuery
I know the official way to wait for an animation is a callback sent
Is there an official way to distribute (deploy) a specific font with a .NET
What is the official way of peeking in a python heap as created by
Is there any official way to allow a CSV formatted file to allow comments,
Is there an official way for an application to determine if it is running

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.