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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:32:55+00:00 2026-05-27T02:32:55+00:00

I just discovered there is a Ajax success handler, which is great because its

  • 0

I just discovered there is a Ajax success handler, which is great because its automated! but I’m unsure if it is suitable for my use-case.

I’m making many ajax calls and mostly programatically (without user clicks etc) so I don’t really want to bind functions to a html element.

This is how I’m doing things ATM but I’d like to automate the process.
The key thing is that the method must get called before everything else and if I catch something then I don’t want execution in my response handler to execute.

function GetSomeData() {     
$.getJSON("/ajax/getsomedata",GetSomeDataResponse);
}
function GetSomeDataResponse(response){
    if(DoesServerResponseIndicateError(response)) {
        //Continue
    }
}
function DoesServerResponseIndicateError() {
//see if it contains any custom errors, if it does, Don't execute the //continue block
}
  • 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-27T02:32:57+00:00Added an answer on May 27, 2026 at 2:32 am

    If you want to automate error handling, I would look at the jQuery.ajaxError function that exists for this purpose. It’s a global handler that will work for all ajax requests you make anywhere on the page.

    Or to make it more fine-grained, there’s an error callback you can use with individual calls.

    Trying to surmise whether the data in a successful ajax call indicates and error will be very difficult and counterproductive.

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

Sidebar

Related Questions

I just discovered the Google APIs Client Library for .NET , but because of
I just discovered the possibility to use vi-mode in zsh. Pretty awesome. But I
I just discovered selenium - a great tool! I plan to run/use selenium-ide generated
I just discovered the Cane gem but it doesn't work with Rails, there is
I just discovered a bizarre bug in my program related to its use of
I just discovered ASP.net uses its own profile system to register users and there
I've just discovered Raphael, and love it, but I am not much of a
I just discovered the box-sizing: border-box CSS property which solves a bunch of cross
I've just discovered VBScript's GetRef function, which gets a reference to the function named
I've just discovered the fullCalendar jQuery plugin which does pretty much everything I need

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.