+ 1

Javascript question

Is there any way to have javascript save a new variable and saves it in the code for instance var = new() let = "ok". Creates a new variable in the script file forever.

5th Jun 2019, 12:29 AM
CodingOni🧙🏿
CodingOni🧙🏿 - avatar
4 Respostas
+ 2
No, JavaScript cannot save any data on file.
5th Jun 2019, 12:45 AM
Calviղ
Calviղ - avatar
+ 2
For globally accessed data, you need to use ajax to update data on server, you also need to develop server script, eg php or nodejs, and also setup database on server. So JavaScript run from front end, ajax data to php on backend server, php script then updata data to database mysql.
5th Jun 2019, 1:34 AM
Calviղ
Calviղ - avatar
0
How would I do this then?
5th Jun 2019, 12:48 AM
CodingOni🧙🏿
CodingOni🧙🏿 - avatar
0
Do that with a cookie
5th Jun 2019, 1:19 AM
Dlite
Dlite - avatar