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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:30:17+00:00 2026-06-04T06:30:17+00:00

I am looking at creating javascript API methods for my application similar to how

  • 0

I am looking at creating javascript API methods for my application similar to how the Facebook or the Twitter Javascript SDK works. Could someone please advice on resources that can help me develop Javascript methods similarly. I intend to do the following:

  • The user should be able to load the Javascript asynchronously.
  • Once the Javascript is loaded, call a method to load an iframe on a specific element.

Appreciate if people could help me on how to achieve this?

  • 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-06-04T06:30:20+00:00Added an answer on June 4, 2026 at 6:30 am

    It’s quite straightforward to do such a thing.

    Loading the library asynchronously is easy, and has nothing to do with facebook, it’s a javascript thing, for example using facebooks’ example:

    (function(d){
        var js, 
            id = "LIB_ID", 
            ref = d.getElementsByTagName('script')[0];
    
        if (d.getElementById(id)) {
            return;
        }
    
        js = d.createElement("script");
        js.id = id;
        js.async = true;
        js.src = "URL_OF_LIB";
        ref.parentNode.insertBefore(js, ref);
    }(document));
    

    That will load your js asynchronously.

    In order to be able to “notify” that the library is loaded you can use the method facebook is using which is to define a callback on the window, so the user of your lib will do something like:

    window.libLoaded = function() {
            // Do what ever when the library is loaded
    }
    

    And in your lib code, at the end just call that callback:

    window.libLoaded();
    

    Creating an iframe dynamically is very easy as well:

    function loadFrame(url, domEl) {
            var frame = document.createElement("iframe");
            frame.src = url;
            domEl.appendChild(frame);
    }
    

    However, you won’t be able to communicate between the iframe document and the main document since (I assume) they won’t share the same domain, and the browser will prevent that due to the same origin policy.

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

Sidebar

Related Questions

I'm looking into the possibilities of creating a Javascript application which makes use webGL.
I'm looking for some Javascript jedi-master to assist in creating a function that adds
i'm looking at creating a web game using html5 canvas and javascript. i was
I'm just looking for some advice. I'm creating a website that offers (at least)
Hi I'm pretty new to javascript looking for some help on creating an argument
I am looking for someone who likes PHP, Javascript (JSON), REST and MySQL to
I am creating a web application based on data using javascript. This data is
I am looking forward to create a javascript API that contains most of the
I'm looking for any alternatives to the below for creating a JavaScript array containing
I'm looking into creating a Rich Internet Application. For the interface, I want something

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.