View Single Post
Old 12-29-2012, 04:09 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
I don't know anything about nodeJS, but this is the bit that shows your data in the html:
Code:
element.innerHTML = data.value;
so I guess at that point if you had made a globally-acessible array like this:
Code:
var mydata=[];
then below the innerHTML line you can push the data onto the array:
Code:
mydata.push(data.value)
or initialize a string:
Code:
var mydata="";
and then add the data to the string:
Code:
mydata+=data.value;
or if you want the var to be overwritten each time data is received (to mirror what is shown in the html)
Code:
var mydata;
and then inside socket.on:
Code:
mydata=data.value;
depends what you want to do, really
xelawho is offline   Reply With Quote