Ask coding questions

← Back to all posts
Storing data with js
MatthewX

Hi, how do use put things into a json file then access the thing u put in the json file?

Voters
MatthewX
Comments
hotnewtop
PattanAhmed

@MatthewX Hi,
You cannot do it in Straight-forward HTML
You need to have help with some Back-end Programming languages to do this...
Thanks!

Hope this helps

MatthewX
PattanAhmed

@MatthewX Like Node.js

MatthewX

@PattanAhmed ima stop this project for now its a little complicated

PattanAhmed

@MatthewX LoL!
You can complete after some time dude.
But don't give up anything.

MatthewX

@PattanAhmed ok ill try

PattanAhmed

@MatthewX Good!

Coder100

Hello, you cannot do this in HTML. You will have to process things with a backend.

MatthewX

@Coder100 um ok

Coder100

so what backend would you like to use @MatthewX

MatthewX

@Coder100 um idk

MatthewX

@Coder100 ill try to learn what backend is

Coder100
SixBeeps

Do you want that JSON file to be global (for something like a leaderboard)? You'll need to use a server framework for that.

JS has JSON.parse() which will take in a string of JSON and turn it into an object. Likewise, you can turn an object into a JSON string with JSON.stringify(object).

MatthewX

@SixBeeps i wanna make like a log in and sign up

SixBeeps

@MatthewX ohhhhh no don't use json for that. that's be way too easily broken into. use something like repl db, and make sure you encrypt everything.

MatthewX

@SixBeeps no dont worry it just to test

MatthewX

@SixBeeps nothing personal for the ppl using it

MatthewX

@SixBeeps also, the ppl wont be using their repl.it accounts. they just make a random new one