[nodejs] Refresh the content without page refresh

2013-01-15 Thread ayaz ali
hello i have developed the chat application using socket.io, expressjs and mongoose it works fine. it refreshes after some seconds and fetches new clients from db if exist. problem is that user can feel that div is refreshsing.and also some time take soem time in response. how to avoid this c

Re: [nodejs] Refresh the content without page refresh

2013-01-15 Thread Murvin Lai
i believe these code are the server code, is that right? can you post the client code? the solution should be in your client code. On Tue, Jan 15, 2013 at 5:52 AM, ayaz ali wrote: > hello i have developed the chat application using socket.io, expressjs > and mongoose it works fine. it refreshe

Re: [nodejs] Refresh the content without page refresh

2013-01-16 Thread ayaz ali
@murvinlai Thanks for response socket.on('updateusers', function(usernames) { jQuery('#usernames').html(''); jQuery.each(usernames, function(key, value) { //jQuery('#usernames').append('' + value + ''); jQuery('#usernames').append('' ); }} This is my cli

Re: [nodejs] Refresh the content without page refresh

2013-01-17 Thread Murvin Lai
seems ok. however, i will suggest you to do that... 1) dont' do jQuery("#usernames").html(""); before the "each" 2) in the each, just construct the string (e.g. var myContect = "" for the html code. 3) only if it is the last one, then you do jQuery("#username").html(myContent); that may help O