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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:21:56+00:00 2026-05-15T14:21:56+00:00

I have jQuery.ajax() creating a request to a url (cms2/docman/dir/%id) (%id is a numeric

  • 0

I have jQuery.ajax() creating a request to a url (cms2/docman/dir/%id) (%id is a numeric unsigned integer). The page requested runs some functions and outputs an array. This array is then run through drupal_json. drupal_json() echo’s out the content first setting the header to

Content-Type: text/javascript; charset=utf-8

So far, everything seems to be going well. The functions are all running and the JSON is being outputted as expected. Through firebug it shows that the response received is JSON and offers the “JSON” tab to preview it.

However, jQuerys jQuery.ajax() function says that a parser error occurred and that it returned “invalid” json. I copied out the json returned and tossed it into an editor (Eclipse PDT) but it shows that there are no errors.

I’m completely stumped at this point. The only thing I can think of is if there is some kind of limit on the amount of text returned via this method.

Creates the request:

function request(url) {
    $.ajax({
        url: url, 
        type: 'POST',
        dataType: 'json',
        async: false,
        success: function(data) {
            if(data.status) {
                docman.store = data.info;
            }
            else {
                docman.hideMessages();
                docman.error(data.message);
            }
        },
        error: function(data,ts,et) {
            docman.hideMessages();
            docman.error(data);
            docman.store = data.responseText;
        }
    });
}

JSON output here – http://codetidy.com/102

  • 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-15T14:21:57+00:00Added an answer on May 15, 2026 at 2:21 pm

    You can use http://www.jsonlint.com/ to check your JSON. You’ll find it tells you that line 136 contains an invalid code:

    syntax error, unexpected TINVALID at
    line 136 Parsing failed

    You need to double escape the character code. (Two backslashes).

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

Sidebar

Related Questions

I have a jQuery AJAX function like this: $.ajax({ url: 'crud/clients.php', dataType: 'json', type:
I have a jQuery AJAX post request that is unexpectedly triggering the error callback
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
Hi I have a jQuery ajax request for a login system. At first, it
I have written some jQuery ajax code where I am sending a request to
I have an Ajax request that returns search results, and I am dynamically creating
I have an AJAX request that grabs the source of Wikipedia pages: $.ajax({ url:
Alright, so I have some jQuery code that will send an AJAX request to
I have a jQuery ajax call that returns html of a table. Now I
I have a jQuery AJAX call that I will need to do multiple times

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.