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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:11:32+00:00 2026-06-10T10:11:32+00:00

I am trying to use GoogleMaps.InfoBox on my project, but before load this script,

  • 0

I am trying to use GoogleMaps.InfoBox on my project, but before load this script, the GoogleMaps API has to be loaded.

Right now I have this code to load everything:

/**
 * Load scripts asynchronously
 */
function loadScript() {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://maps.googleapis.com/maps/api/js?key=-MY-KEY-&sensor=true&callback=initialize";
    document.body.appendChild(script);
    var scriptInfoBox = document.createElement("script");
    scriptInfoBox.type = "text/javascript";
    scriptInfoBox.src = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox_packed.js";
    document.body.appendChild(scriptInfoBox);
}

But not always the GoogleMaps API is loaded before than GoogleMaps.InfoBox one.

How can I load JS sorted, waiting for complete the previous one?

  • 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-10T10:11:33+00:00Added an answer on June 10, 2026 at 10:11 am

    You can use the load event of the scripts:

    function loadScript(callback) {
        var script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "http://maps.googleapis.com/maps/api/js?key=-MY-KEY-&sensor=true&callback=initialize";
        document.body.appendChild(script);
        script.onload = function() {
            var scriptInfoBox = document.createElement("script");
            scriptInfoBox.type = "text/javascript";
            scriptInfoBox.src = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox_packed.js";
            document.body.appendChild(scriptInfoBox);
            scriptInfoBox.onload = callback;
        };
    }
    

    However, you will need to adapt the code a bit to make it crossbrowser-safe like this.

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

Sidebar

Related Questions

I am trying to use Google Places in Google Maps API v3, but I
I'm trying to use the Google Maps geocoder with Python and JSON, but keep
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am need paint my image. I'm trying use JQuery in here this link:
I'm trying to use the GMap.NET.WindowsForms control in my Windows forms application but I
I'm trying to use the GoogleMaps JavaScript library from inside of SpiderMonkey using the
I'm trying to use Google Maps API and i'm stuck here: I need an
GOOGLE MAPS API V3 is what i'm trying to use. I have all the
Hey I am trying to use this USGS web service: http://gisdata.usgs.gov/XMLWebServices/TNM_Elevation_Service.php and I am
I am trying to use multiple emulators for the same project and running into

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.