Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
fail() handler also fires on HTTP200 and HTTP202

I have this simple code:

function dlgEditPhase_okClicked(dlgEditPhase, event) {
    $.post("/overview/phase/"+dlgEditPhase.projectId, 
        JSON.stringify({
            "phaseName": dlgEditPhase.phaseName,
            "begin": dlgEditPhase.begin,
            "end": dlgEditPhase.end
        }),
        function(data) {
            dlgEditPhase.close();
            location.reload();
        },
        "json"
    ).fail(function(data) {
        alert(data.responseJSON);
    });
}

Problem is, the fail is always fired, even when the POST call returns code 200 or 202.

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Fail can also fire because response is not a valid json

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!