Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Mr.Easybb (1587)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Bloodbath (745)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Rukiafan (533)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Dom (513)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
puppycheese (446)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
pedro (330)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Neymar (301)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Hitsu (281)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 
Flora (275)
Store a data inside a JSON Vote_lcapStore a data inside a JSON Voting_barStore a data inside a JSON Vote_rcap 


Store a data inside a JSON

gillgill
Status : Syntax highlighter's colors are nice.

Posts : 78
Join date : 2014-04-05
Thu 06 Aug 2015, 08:06
I wonder how to store a data into JSON? Maybe something like this.

Code:
{
"Name":"gill",
"Status":"Great."
}

I wonder how to do that? I want to get a data inside an input data from another page. So if the user sends the data it might keep the data as JSON. Actually no. I want to grab datas inside a shoutbox, but I'll figure that myself. I just want to know a simple how to first. Even a simple guide might helps.

Thx.
gillgill
Status : Syntax highlighter's colors are nice.

Posts : 78
Join date : 2014-04-05
Thu 06 Aug 2015, 13:01
Bump I need this hardly. I know it's not 24 hrs but I need this, help!
Ange TuteurAnge Tuteur
Status : No status yet...

Posts : 109
Join date : 2014-02-18
Age : 28
Location : North America
Thu 06 Aug 2015, 17:34
Are you asking how to use JSON ? There's information on it on MDN : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON

This would be the best example that I can give you of using it :
Code:
[panda=js](function() {
  if (window.JSON) {
    var a, b, object = {
     
      row_a : {
        msg : 'Hello',
        name : 'User 1'
      },
     
      row_b : {
        msg : 'Goodbye',
        name : 'User 2'
      }
     
    };
   
    a = JSON.stringify(object); // convert the object to a string
    console.log(a);
   
    b = JSON.parse(a); // parse the stringified object for use in javascript
    console.log(b);
  }
})();

It's not the best example, but I'm sure it gets the point across.
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Tue 18 Aug 2015, 06:13
Well, if you want to store data inside JSON we can use variable.

Code:
[panda=js]var letmego = document.getElementById("myinput").innerHTML;

var me = {
 testing : {
  inp : letmego
 }
};
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Mon 24 Aug 2015, 17:46
Hitsu JSON is written as so

Code:
[panda=js]{
    "property":"value"
}

A javascript Object is written as so

Code:
[panda=js]var me = {
 testing : {
  inp : letmego
 }
}

They are basically the same thing but when you write a JSON file you don't use variables to declare them. Anyways if you are calling an AJAX request you'd return the JSON returned object as a variable.The question at hand is sort of clear but then again it's not as well. So if you give more information it may help OP.
Sponsored content