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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:36:57+00:00 2026-05-11T08:36:57+00:00

I’m writing a JavaScript widget, which is intended for use on other website and

  • 0

I’m writing a JavaScript widget, which is intended for use on other website and loads additional script files from my own web site (which basically means no XHR due to cross-domain limitations). Now I want to handle failures gracefully – if one script fails to load, I want to load the script from an alternate server.

I managed to handle server failures where the 1st server returns an error, but I also want to handle a timeout – if the 1st server takes too long to respond I want to abort the load and switch to the alternate.

The problem I have is that I can setup a timeout to trigger a method that switches to the alternate server, but the script from the alternate server doesn’t load successfully until the browser itself times-out on the original request – which is way too long for my needs.

I want to be able to – while the 1st <script> tag is loading – abort the load, and add a second <script> tag that points to the alternate server.

I’ve tried setting the original script’s src attribute to null, and even removing the tag from the HEAD element using removeNode(), but to no effect.

This all was tried on Firefox – I haven’t tried IE yet, but the solution has to work on both. I’d love to hear any suggestions.

  • 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. 2026-05-11T08:36:58+00:00Added an answer on May 11, 2026 at 8:36 am

    Unfortunately it’s not possible to cancel the request for tags. Historically browsers only allow 2 requests at the same time to one hostname, so it should be possible to load the second script from another server.

    Do you initiate the script loading before body.onload? For a normal page load the browser waits for each script to load before continuing since the scripts can alter the document. If the script is not modifying the document, you can use the defer attribute so the browser continues to render the document while your script loads.

    jQuery has a few open requests on a similar feature: http://dev.jquery.com/ticket/1863 http://dev.jquery.com/ticket/3442

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

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Microsoft's Design Guidelines for Developing Class Libraries is a very… May 11, 2026 at 11:39 pm
  • Editorial Team
    Editorial Team added an answer I don't think that's possible. The only thing the system… May 11, 2026 at 11:39 pm
  • Editorial Team
    Editorial Team added an answer You can use google-api-translate-python to talk to google api. EDIT:… May 11, 2026 at 11:39 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.