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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:46:16+00:00 2026-06-15T03:46:16+00:00

In my $.ajax I have error: function (xhr, ajaxOptions, thrownError) { var result =

  • 0

In my $.ajax I have

error: function (xhr, ajaxOptions, thrownError) {
            var result = $.parseJSON(xhr.responseText);
            alert(result.ErrorMessage);
  }

Even though this has worked for all my previous apps, this time this choked and gave me an invalid JSON error. I am using jQuery 1.5, asp.net MVC 3.

PS: I looked at the jQuery documentation but I didn’t see the example of what JSON consumed by error should be.

  • 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-15T03:46:17+00:00Added an answer on June 15, 2026 at 3:46 am

    What is the value in xhr.reponseText? Just print it out using console.log(). Unless you are formatting your error pages as JSON, you’re probably getting some standard 500 HTML from the server, that’s why you can’t parse it as JSON.

    jQuery does not dictate the responseText that is returned by the server in case of an error

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

Sidebar

Related Questions

Within my ajax call if an error is received I have an alert :
I have the following AJAX call: $('#FonykerUsernameRegister').blur(function(){ if($(this).val().length > 2) { alert($(this).val()); $.ajax({ url:
I have the following AJAX function: function ajaxDesignerBrandInfo() { var D = wrapFormValues('#designer-brand-form'); var
I have the following AJAX function with JQuery: var formData = $('#FonykerEditForm').serialize(); $.ajax ({
I have an error Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to
I have a strange error where my jquery ajax request doesn't submit all the
I have a jQuery AJAX post request that is unexpectedly triggering the error callback
I have an $.ajax call that includes both a success and error condition: $('input[name=StateName]').live('change',
I have a bunch of ajax calls that contain success and error conditions like
I have this function when I click on my submit button: $('#signup-button').click(function(event){ var username_check

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.