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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:51:27+00:00 2026-05-10T21:51:27+00:00

I went to http://www.json.org/js.html and downloaded the json2.js, thinking i’d be fine, afterall that

  • 0

I went to http://www.json.org/js.html and downloaded the json2.js, thinking i’d be fine, afterall that site is on the top in a google search for ‘json javascript’ – also they have this really cool url 🙂

So i’ve been working a bit with it and it seemed fine, but now i start running into trouble with it – it simply won’t parse certain stuff i encode with Newtonsoft’s JSON .NET serializer. Ok so perhaps the .net seralizer messes up? Not how i see it – it produces a fine javascript string that looks like perfect json.

The problem comes when it has to encode a single quote ‘ and perhaps double quotes ‘. Take a look at these examples (only parts of the full string)

{'Id':10651,'Text':'\'69'} {'Id':184,'Text':'13\''} 

Am I missing something? it’s part of a bigger string and all put in a javascript variable like this

var jsonObject = '[{'Id':46,'Type':2,..................... 

I’m thinking it has to escape the singlequote in the string to avoid conflicting with my wrapping of the string in single quotes, and escape the double quote to avoid conflicting with the json format?

So either i’m doing something wrong or the json2.js is not doing it right? Or yeah perhaps the .net json is messing up – i’m kinda thinking i’m messing it up, but i’ve been trying to do all sorts of stuff to help with the parsing like escaping/unescaping etc. before the serializing/deserializing.

  • 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. 2026-05-10T21:51:28+00:00Added an answer on May 10, 2026 at 9:51 pm

    Ok i solved the problem. Actually the hint Joel gave me in the comment on my question to try and eval it instead lead me to thinking i can trust this json i’m trying to parse/eval, and since i know it at the time of building the page, why not hardcode it into the webpage AS an object – no escaping of quotes or anything and no evaluating and best of all – no strings 😛

    So thanks to both you Joel and you torial 🙂

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

Sidebar

Related Questions

I followed went through some related threads and also followed the tutorial on http://www.quirksmode.org/js/cookies.html
I went to the xdebug site, but I can't find a mac download. http://www.xdebug.org/download.php
I am starting to learn JBoss. Went to the download page http://www.jboss.org/jbossas/downloads.html but I
I went through the documentation in http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cond_wait.html but this is not mentioned explicitly. Any
I went through a document at Adobe Livedocs that describes working with pdf: http://livedocs.adobe.com/flex/3/html/help.html?content=PDF_1.html
Following http://www.haskell.org/haskellwiki/Gtk2Hs/Windows#Windows_7_32_bit I installed Gtk2Hs / Glade and everthing went well. Now at C:\Users\X\Desktop\test
I went to the following site to check out some sweet custom fonts: http://www.fontspace.com/category/ninja
I went through this tutorial (http://www.adobe.com/devnet/facebook/articles/flex_fbgraph_pt4.html) and got everything working, only to find out
I went to http://www.asp.net/mvc/ to try to install ASP.NET MVC. I didn't know, but
I went to http://www.asp.net/mvc and the web installer offered me the option to install

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.