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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:45:53+00:00 2026-05-22T00:45:53+00:00

Can I (using javascript) detect if a javascript file has already loaded, and if

  • 0

Can I (using javascript) detect if a javascript file has already loaded, and if not, add an onload handler? The script tag is added dynamically by a 3rd party library so I’m not able to dynamically insert it myself.

  • 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-22T00:45:54+00:00Added an answer on May 22, 2026 at 12:45 am

    This is ugly solution, but possible:

    function thirdPartyLoaded() {
      // here we will have code, that will be executed,
      // when 3rd party script will be loaded
    }
    
    // Also we know, that 3rd party have some global object or function
    // Let it be IAm3dPartyFunc for example
    
    // Then we somewhere add continuos watcher function with setInterval
    var watchFor3rd = setInterval(function(){
        if (undefined != IAm3dPartyFunc) {
            thirdPartyLoaded();
            clearInterval(watchFor3rd);
        }
    }, 500);
    

    This function will be called each 500ms (0.5 second) and will check, if we have some global object/function, that 3rdparty could have. But if 3rdparty is made by the true gosu, then it couldn`t have any global stuff, as all work could be in some anonymous function and this solution will not work.

    You should state, which 3rdparty you want to use and when.

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

Sidebar

Related Questions

How can I manipulate using JavaScript (JQuery) a site, not in my server, that
Can I tell, using javascript, whether a user has clicked on the X icon
I need to detect OS language using javascript so I can view my page
I am making a cross-domain JSON(P) call by using JavaScript to add a <script>
How to detect bit-version of operating system using javascript (32 or 64)? It can
In javascript, possibly using jQuery, how can I detect if the html content of
How can I detect a Scrollbar presence ( using Javascript ) in HTML iFrame
Is there a way to detect if javascript is executing a script using either
it can be done using javascript, but with CSS alone, is it possible to
How can you preload an entire web page using JavaScript so that I can

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.