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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:04:36+00:00 2026-06-18T03:04:36+00:00

I was wondering if there is a NON jquery solution to this scenario: there

  • 0

I was wondering if there is a NON jquery solution to this scenario:

there is no reply to the ajax request because either the server got its internet connection down, the client got its internet connection down, or the server crashed. Is there some built in method/event in the xmlhttprequest object which can help in this issue ?

  • 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-18T03:04:38+00:00Added an answer on June 18, 2026 at 3:04 am

    You can set the timeout property:

    var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                done(request.responseText);
            }
        },
        done = function (response) { console.log(response) },
        fail = function () {};
    
        xhr.open("GET", "url", true);
        xhr.timeout = 4000;
        xhr.ontimeout = function () { xhr.abort(); fail(); }
        xhr.send();
    

    Or just use window.setTimeout

    var xhr = new XMLHttpRequest(),
        timeout;
    
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                done(request.responseText);
                clearTimeout(timeout);
            }
        };
    
        xhr.open("GET", "url", true);
        xhr.timeout = 4000;
        xhr.ontimeout = function () { xhr.abort(); fail(); }
        xhr.send();
        timeout = window.setTimeout(function () { xhr.abort() }, 4000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there are any good non-native form inputs for web development? I
Just wondering if there are any typical issues when using this form of database
I am new to python and was wondering if there was a better solution
I am wondering if there is a way to overload operator[] for a non-class
I'm wondering if there is a way to look at the values of non-declared
I am wondering is there any other way to make a non-synchronized data structure
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
I am wondering if there's a way to detect non-ASCII characters in Rails. I
I'm wondering if there's a speedy, Pythonic way to calculate factorials of non-integral numbers
Wondering if there are good alternatives to this that perform no worse than what

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.