Monday, 12 August 2013

socket javascript global variable

socket javascript global variable

websocket
1 .//hi guys.. i have a problem with my global variable n ;
var n ;
socket.on('connect', function(){
socket.on('news', function (mensaje) {
n = mensaje.data;
$('#string').val(n); // show data
});
$('#string1').val(n); // i can't see something? why
...});
//
"sorry for my english" first at all my global variable n only run in
socket.on but i want show out that function

No comments:

Post a Comment