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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:24:13+00:00 2026-06-10T02:24:13+00:00

Using JavaScript, is there a way to detect whether or not an external script

  • 0

Using JavaScript, is there a way to detect whether or not an external script (from a third-party vendor) has completely loaded?

The script in question is used to pull in and embed the markup for a list of jobs and, unfortunately, doesn’t make use of any variables or functions. It uses document.write to output all of the content that gets embedded in my page.

Ideally, I’d like to display some kind of loading message while I’m waiting for the external script to load, and if it fails to load, display a “We’re sorry, check back later…” message.

I’m using jQuery on the site, but this external script is called before I make the jQuery call.

Here’s what the document.write stuff from the external script looks like:

document.write('<div class="jt_job_list">');
document.write("
    <div class=\"jt_job jt_row2\">
        <div class=\"jt_job_position\">
            <a href=\"http://example.com/job.html\">Position Title</a>
        </div>
        <div class=\"jt_job_location\">City, State</div>
        <div class=\"jt_job_company\">Job Company Name</div>
    </div>
");
  • 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-10T02:24:15+00:00Added an answer on June 10, 2026 at 2:24 am

    Thanks for the assistance above, especially ngmiceli for the Steve Souders link!

    I decided to take what’s probably a “lazy” approach, and also forego the “loading” message:

    $(document).ready(function(){
        if ($('.jt_job_list').length === 0){
            $('#job-board').html("<p>We're sorry, but the Job Board isn't currently available. Please try again in a few minutes.</p>");
        };
    });
    

    Pretty simple, but I’m looking to see if an element with the .jt_job_list class is in the dom. If it isn’t, I display an error message.

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

Sidebar

Related Questions

Is there a way to detect if javascript is executing a script using either
Is there any way to completely process a form using only javascript & html
Is there any way, via C# code, to detect whether JavaScript is enabled or
Is there any way to detect the current keyboard layout using JavaScript? I found
Is there a way, using JavaScript or jQuery, to detect when someone goes back
Is there a way to detect, using javascript or a js library, if my
Is there a way to detect finger drags using Javascript on touch phones? I'm
Is there a way to parse html content using javascript? I have a requirement
Is there any way to cut an image into smaller pieces using JavaScript? Like,
Is there a way to access the page HTML source code using javascript? I

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.