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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:09:32+00:00 2026-05-17T20:09:32+00:00

It looks like jQuery’s .ajax function fires the ‘success’ function even when it gets

  • 0

It looks like jQuery’s .ajax function fires the 'success' function even when it gets no response from the server. I’d consider this an error. I detected this event by checking to see if the 'request.status===0', are there any other instances that I should check for where the 'success' function will be fired even if there is an error situation?

I’ve posted the code I’m using now below. How is this type of situation normally handled?

$.ajax({ 
    async : true, cache : false, dataType : 'json',
    type : 'POST',
    url : 'person/' + personKey,
    data : JSON.stringify({firstName:'Jilopi',}),

    success : function(data, textStatus, request){
        if( request.status === 0 ){
            alert('Error: problem saving person - no response');
        }else{
            alert('Success: saved person');
        }
    },
    error : function(request, textStatus, errorThrown){
        alert('Error: problem saving person');
    },
});
  • 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-17T20:09:33+00:00Added an answer on May 17, 2026 at 8:09 pm

    You’ve identified the only “false success” issue I know of. To elaborate on it a bit: this was a work-around in place strictly for Opera (which returns what’s actually a 304 as a 0), you can see the comment in 1.4.2 (and prior versions) here: http://github.com/jquery/jquery/blob/1.4.2/src/ajax.js#L551

    However, it has been removed in jQuery 1.4.3 because of your exact issue, you can see the change that did it here.

    Short answer: upgrade to jQuery 1.4.3+ to resolve your issue and you can do away with your status === 0 check.

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

Sidebar

Related Questions

I have a function in jquery that looks like this. function interceptFilter(e){ $.ajax({ type:
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
I have some jquery that looks like this, $('.career_select .selectitems').click(function(){ var selectedCareer = $(this).attr('title');
I'm having an issue in the success callback of my ajax function. On success
jQuery hashchange event For me it looks like most mature solution right now(please correct
I have some code in jquery which looks like this: $(#filterZaal).attr(disabled, disabled); $(#filterGenre).attr(disabled, disabled);
I know it's possible with jquery to make something that looks like a select
So I was working with jQuery's .load() just now and it looks like we
I'm looking for a recommendation for a JQuery plug-in that looks like and will
It doesn't look like basic javascript but nor can I use JQuery commands like

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.