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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:40:31+00:00 2026-06-13T12:40:31+00:00

Server returns this JSON document: { username-found: true, question-required: true } Which successfully passes

  • 0

Server returns this JSON document:

{
"username-found": true,
"question-required": true
}

Which successfully passes JSONLint’s validity check.

In web browser:

$.post('my_url', {"post":"data"}, function(data) {
  data = $.parseJSON(data);
});

The code runs and successfully parses the JSON document in Opera 12 browser, however in Firefox 16, JavaScript error occurs and says “not well-formed”.

JQuery is of version 1.7.2.

I cannot see what I did wrong there, do you know?

Edit:

Does it have anything to do with the way server returns the JSON? Here it is:

return new StreamingResolution("text", new StringReader(json.toString()));

uggestion, I might have found the cause. When I did alert(data), Firefox tells me that data is an object, Opera tells me that data is the JSON string.

  • 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-13T12:40:32+00:00Added an answer on June 13, 2026 at 12:40 pm

    Solution 1 (Client) – Set DataType in jQuery Request

    I think the internals are a bit different in that specific browser version (because jQuery tries to detect the dataType automatically and is doing the parsing internally in the case of a JSON response) and JSON is automatically encoded in FF and not in Opera?

    Try to add the dataType so jQuery will handle this (I would prefer that):

    $.post('my_url', {"post":"data"}, function(data) {
        // data should be an json object here
    }, 'json');
    

    It’s just a guess.

    OR Solution 2 (Server) – Send MIME type

    You could also send a correct MIME type from the server so you don’t have to set the dataType on the client. Its up to you but I think that would be the correct solution.

    Regarding this answer it should be application/json.

    Reference

    How is the dataType detected automatically in jQuery?

    Default: Intelligent Guess (xml, json, script, or html) The type of
    data that you’re expecting back from the server. If none is specified,
    jQuery will try to infer it based on the MIME type of the response (an
    XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript
    object, in 1.4 script will execute the script, and anything else will
    be returned as a string).

    Source: http://api.jquery.com/jQuery.ajax/

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

Sidebar

Related Questions

I'm trying to return json content read from MySQL server. This is supposed to
When I deployed my application on the server I faced this issue: Request.Url.ToString(); returns
I have a server that returns JSON in the following format: [{Name: Student1, Email:
I have a simple jquery/ajax request to the server which returns the structure and
I have my php coded page on one server that returns a json result.
A simple get request made to url on my server which returns HTML of
I have noticed many code examples of calling a web service which returns json
I have a RESTful webservice which i can successfully ping on the published server
I'm calling $_SERVER[REMOTE_ADDR] and it returns '::1' Any ideas why am I getting this
Why does this script return a pair of nulls? I'm using SQL Server 2008,

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.