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

  • Home
  • SEARCH
  • 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 6641789
In Process

The Archive Base Latest Questions

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

I have defined in my head tag a function <script> functionX(a,b,c) ….</script> which calls

  • 0

I have defined in my head tag a function <script> functionX(a,b,c) ....</script>

which calls some third party js. The actual function is this:

    <script>
    function fbc(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";  
          fjs.parentNode.insertBefore(js, fjs);   
    }
    </script>

and later on I want to call that function. I’m calling it using and HTML widget in the following way:

    HTML html = new HTML();
    setHTML(
            "<script>"+
            "   fbcomment(document, 'script', 'facebook-jssdk');   "+
            "</script> "+  
            "<fb:comments width=\"600\" num_posts=\"2\" href=\"http://www.woojah.com\"></fb:comments>");

However, it is not executing properly. Any advice would be very useful.

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

    It is more idiomatic to call external functions using JSNI:

    native void facebookComment(Document d, String s, String id) /*-{
      fbc(d, s, id);
    }-*/;
    
    void myFunction() {
      facebookComment(Document.get(), "script", "facebook-jssdk");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function defined inside the script tags of head.(in a JSP) I
I have a Site.Master in my ASP.NET project which defines a HEAD section as
I have defined a ConfigurationProperty class, which is basicly a key-value pair (with key
I have defined the following two functions test <- function(t) { return( (0.5*eta^2/theta)*(1-exp(-2*theta*t)) )
I have defined a table type PL/SQL variable and added some data there. create
I have defined a rectangle drawable like this: <shape xmlns:android=http://schemas.android.com/apk/res/android android:shape=rectangle> <corners android:radius=4dip/> <solid
I have an aspx page that includes a javascript file in the head tag.
W3Schools have this to say about labels : The <label> tag defines a label
I have been hitting my head against the wall with this one for few
In _Layout.cshtml I have the following defined in the tag: @RenderSection(JavaScript, required: false); 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.