Hello, I’m a beginner, i was just wondering if it was possible to, in glitch, retrieve like for example a password created in one page, and retrieving that same password in another page.
If your making a way to store a password in a server or database (where the data can be retrieved) and being able to retrieve it then you can use something called an http request. Basically you send a get request to the thing storing the password like a node js server and the data is retrieved if you make the node js server be able to handle those get requests.
Thank you!! i really appreciate it!
No problem, and if your’e wondering. This is what an http request looks like (they most commonly are in JavaScript):
fetch(“your server url here”)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(“Error:”, error));
And then in the server code (Node.js code which is also JavaScript):
let PASSVARIABLE=“password here”
if (req.method === ‘GET’) {
res.writeHead(200, { ‘Content-Type’: ‘application/json’ });
res.end(JSON.stringify({ password: PASSVARIABLE }));
}
It should look something like that, so if your are using html and JavaScript with a node js server thats the best way to go, also if you only want certain people to be able to see the password i can help with that too.
omg literally thank you so much, ill definitely try node js for this, and dont worry, im okay with just this.
Once again, thank you for your help!!!