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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:13:15+00:00 2026-06-07T20:13:15+00:00

Here is a code fragment from a page: $(#add_new).button().click(function (ui,event) { var postdata =

  • 0

Here is a code fragment from a page:

$("#add_new").button().click(function (ui,event) {
    var postdata = {
        "action":"new",
        field_kind_id:2,
        collection_id:null,
        parent_id:null,
        app_struct_id:null,
        member_id:1033,
        app_id:1003,
    };
    $.ajax({
        url: "?",
        type: "POST",
        data: postdata,
        error: function(jqXHR, textStatus, errorThrown) {
            $().toastmessage("showErrorToast",
                "AJAX call failed: "+textStatus+" "+errorThrown);
        },
        success: function(data) {
            edit_record(data);
            return false;
        }
    });
});

Actually the POST-ed data is something like:

action  new
app_id  1003
app_struct_id   null
collection_id   null
field_kind_id   2
member_id   1033
parent_id   null

And the response is this string:

{\x22app_id\x22:1003,\x22member_id\x22:1033,\x22collection_id\x22:\x22-6885\x22,\x22field_kind_id\x22:2,\x22sample_id\x22:\x22\x22,\x22parent_id\x22:\x22\x22}

The response is not valid json data. It has a special format. My problem is that the above ajax call displays this toast message:

“AJAX call failed: parsererror SyntaxError: illegal character”

So it seems that the AJAX call has failed. But I don’t understand what is checking the syntax? What kind of syntax? The JQuery Ajax call did not have “dataType:json” specified. So there should not be any syntax to be checked. What am I missing?

The JQuery documentation says the default value for “dataType” is “intelligent”

“Intelligent Guess (xml, json, script, or html)”

If the response cannot be interpreted as a JSON value, then it is not a JSON value, right? Either it is not a valid JSON value (in that case, it should not be converted) or it is (but then it should not throw an exception?) Does it mean that jQuery is not intelligent enough?

  • 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-07T20:13:18+00:00Added an answer on June 7, 2026 at 8:13 pm

    What is the value of the Content-Type header in the response from the server? I would expect any guessing that is performed regarding the format of the content to be based on that.

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

Sidebar

Related Questions

Here is code from MSDN . I don't understand why the work isn't just
I have a problem with memory allocation using malloc. Here is a fragment from
here is full code from algorithm and data structure in java written in c++
I'm stuck here with a problem starting an activity from a Button inside a
The following code fragment does nothing, but illustrates the problem. It was extracted from
Here's a fragment of code I'm prototyping that should, by all accounts, never see
Can someone dumb it down and explain, how this code fragment from a previous
Below is the code fragment I have issue with socket programing. Here after select
A typical code fragment obtained from the YouTube embed feature looks like this: <object
I m trying to run the code given here - http://code.google.com/p/android-honeycomb-fragment-tutorial/source/browse/#svn%2Ftrunk%253Fstate%253Dclosed on a 7

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.