Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

160
Views
how to pass a variable from one page to another using nodejs (to 1 specific user)?

I am currently using Nodejs to have post multiple html files I have

app.get('/',function (req,res) {
//console.log(Date().toString() +'\n' + "Client side Viewing.........\n");
res.sendFile('C:\\Users\\Documents\\Document\\F10N_MFG\\Commit\\Commit.html');
});


app.get('/Commit_Edit',function (req,res) {
//console.log(Date().toString() +'\n' + "Client side Viewing.........\n");
res.sendFile('C:\\Users\\Documents\\Document\\F10N_MFG\\Commit\\Commit - Edit.html');
});

and I use SocketIo to pass variable around from client to server and server back to client

I want to have a page that collect a client selection (variable) and pass back to server and the server will trigger that client-side to open a new browser tab that bring over the variable he choose only to that specific client and meanwhile not changing other clients selection.

is it possible?

10 months ago · Santiago Trujillo
1 answers
Answer question

0

for now, I have an solution by including the variables in link address

I added the variable in the link and run it

http://mfgrpa2:4000/lot_list?param=value/

var x = window.location.href.search("param=");
var y = window.location.href.substring(x+6,window.location.href.length);
var z = y.replaceAll("%20"," "); //replace any %20 to space;
console.log(z);

and it works.

10 months ago · Santiago Trujillo Report
Answer question
Find remote jobs