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

It looks like jQuery 1.6.4 deliberately swallows exceptions in $.ajax success callbacks. If I
i have ajax function that looks like this: jQuery.ajax({ type: 'POST', data: { action:
I came across a piece of code which looks like this: jQuery(function($) { $('#saySomething').click(function()
jquery looks like this $.post('JSP/processForm.jsp', $(#Form).serialize(), function(data){ //I want to iterate through every line
I've built a jQuery selector for a function which looks like this: $('html').not('.table-main tr[selected]').mousedown(
I have a problem with a jquery function. My HTML looks like this, I
How can i create a function which looks like the jquery callback $ Say
My application.js file looks like this: //= require jquery //= require jquery_ujs //= require
I have a jquery selector which looks like this: $(#MasterListDVWP tr td:contains(' + currentSchool
I'm using nested pages in Jquery Mobile: Looks like this: // wrap page <div

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.