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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:35:14+00:00 2026-05-28T07:35:14+00:00

Every once and a while I hit a button on my web application and

  • 0

Every once and a while I hit a button on my web application and I get no response. The “button” initiates an ajax call. My guess is that there is heavy web traffic…and it times out or similar. Is there a maximum wait time for ajax responses from the server? Is there a way to log this behavior. Here is my ajax code.

 var Ajax = {
    createAjaxObject: function()
    {
        var request;
        try
        {
            request = new XMLHttpRequest();
        }
        catch(error)
        {
            try 
            {
                request = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(error)
            {
                try
                {
                    request = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch(error)
                {
                    request = false;
                }
            }
        }
        return request;
    },

    useAjaxObject: function( path, param, ajax_func, html_div )
    {
        var object = new Ajax.createAjaxObject();
        object.open( "POST", path, true );
        object.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" );
        object.setRequestHeader( "Content-length", param.length );
        object.setRequestHeader( "Connection", "close" );
        object.onreadystatechange = function()
        {
            if( this.readyState === 4 )
            {
                if( this.status === 200 )
                {
                    ajax_func( this.responseText, html_div );
                }
                else
                {
                    Ajax.repeatUseAjaxObject( path, param, ajax_func, html_div );
                    return false;
                }
            }
        };
        object.send( param );
        return true;
    },
    repeatUseAjaxObject: function( path, param, ajax_func, html_div )
    {
        var state = false,
            count = 1;
        while(state === false && count <= 5)
        {
            state = Ajax.useAjaxObject( path, param, ajax_func, html_div );
            if( count !== 1 )
            {
                alert( 'Ajax Object Use Failed ');
            }
        count++;
        }
    }
  • 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-28T07:35:15+00:00Added an answer on May 28, 2026 at 7:35 am

    Sometimes the response could be of the wrong expected type, or the server is returning an error status code/page instead of the actual requested information. A good way to check the full response (or if there really is a lack of a response) is with a good HTTP traffic proxy debugger such as:

    Fiddler
    http://fiddler2.com/fiddler2/ (Free)

    or Charles
    http://www.charlesproxy.com/

    They will give you full information about the life cycle of each web request. As far as minimum or maximum times, generally the server has a setting for the timeout of any given request.

    Client Site Timeout: From the jQuery Api… Not sure since you’re rolling your own.

    Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent.

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

Sidebar

Related Questions

Every once and a while I get this error in IE when making an
Im using Visual studio 2008. Every once in a while files that exist in
I have a web scraping script that gets new data once every minute, but
I have a MySQL database that is continually growing. Every once in a while
every once and a while my application throws a connection to database lost error.
Every once and a while, I have to get the basics to a language
Every once in a while, typically when I stop debugging in our UI assembly,
I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every
Every once in a while I try to add a new data model version,
Every once and a while Emacs fails at syntax highlighting and the coloring gets

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.