Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

JSOn Parsing using JAvascript

Discussion in 'Scripting' started by abhishek20502025, May 26, 2015.

?

JSON parsing using JAVASCRIPT

  1. for reading file

    0 vote(s)
    0.0%
  2. for writing to a file

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. abhishek20502025

    abhishek20502025

    Joined:
    May 19, 2015
    Posts:
    9
    I want to read and write file content using JSONparsing using javascript
    attaching my javascript file and json txt file...
    help
     

    Attached Files:

  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
  3. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    There is also JSON .NET it has a really good feature set and never gave me problems in the past
     
    Ryiah and Dustin-Horne like this.
  4. abhishek20502025

    abhishek20502025

    Joined:
    May 19, 2015
    Posts:
    9
    thnks...but still could you please let me know about my wrong approach in code....
     
  5. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Just as an FYI, JSON .NET does work with JavaScript but you have to move the asset to a /plugins folder so it compiles before the Unityscript does. It was an oversight I made when originally building my folder structure.
     
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    I'm not exactly sure what you're trying to do... what JSON parsing library are you using? And why are you rebuilding XML from the JSON? You could probably get away with using a free asset like JSONObject to parse that Json as it's really pretty simple.