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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:24:04+00:00 2026-06-11T17:24:04+00:00

When I send an Ajax request in JavaScript (with JQuery), it sometimes throws an

  • 0

When I send an Ajax request in JavaScript (with JQuery), it sometimes throws an internal server error that I can’t catch. The error shows up in the browser. I even tried to wrap the ajax call in a try – catch block. How can I handle the Ajax error?

EDIT
here is my code:

$.post('/multi/getGameStatus', function(data) {
    if(data && data.game) {
        settings.game = data.game;
        setStartRacePopupUI.call(this, data);
        // remove all racers
        removePlayers.call();
        for(var i=0;i<settings.game.players.length;i++) {
            var player = settings.game.players[i];
            var isme = (player.id == settings.playerId);
            addPlayer.call(this, player, isme, i);
        }

        if (settings.game.gameStatus == "OPEN") {
            setTimeout(refreshPlayers, refreshPlayersInterval, nextStatus);
        } else if(settings.game.gameStatus == "IN_GAME") {
            counterToGameStart = data.sts;
            gameFllow(nextStatus);
        }
    }
});

Even if I use the error handler I still get a JS error on the page

  • 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-11T17:24:06+00:00Added an answer on June 11, 2026 at 5:24 pm

    http://api.jquery.com/jQuery.ajax/

    …For convenience and consistency with the callback names used by
    $.ajax(), jqXHR also provides .error(), .success(), and .complete()
    methods.

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks
    will be deprecated in jQuery 1.8. To prepare your code for their
    eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always()
    instead.

    // Assign handlers immediately after making the request,
    // and remember the jqxhr object for this request
    var jqxhr = $.ajax( "example.php" )
        .done(function() { alert("success"); })
        .fail(function() { alert("error"); })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ajax request that do 3 missions: Save Model (DB) Send Email Give
Perl script needs to receive ajax request, send a success message back to browser,
Can anybody pls tell me, how can i make a AJAX request and send
I'm designing a template creation tool, which uses a jQuery Ajax request that posts
When I perform an asynchronous request with jQuery Ajax, sometimes the response is returned
Issue I have an aspx page with jQuery code to send an ajax request
I need to send a polling AJAX request to the server and send some
When I try to send an array to Django via Ajax (jQuery) JavaScript code:
1 client : send request to server via AJAX fn. 2 Server : response
I want to send Ajax request to controller, I make like this in the

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.