Have you looked at Web Sockets? On Sun, Jan 17, 2010 at 5:17 AM, Izad CM <iza...@gmail.com> wrote:
> Hmm...., I get what you mean, but how exactly do I update the label > text in real-time? One of the better ways that I've discovered is by > using "long polling" technique ( > > http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/ > ). What do you think? > > On Jan 17, 12:16 am, waseem sabjee <waseemsab...@gmail.com> wrote: > > I'm guessing you mean like on google wave. > > > > ok. > > AJAX would mean passing data to a file and returning a response to the > user > > without refreshing the page the user is on. > > > > you could say what you want falls sort of under JavaScript animation > > > > say you have something like this. > > > > <textarea class="editable">My test th at can be edited</textarea> > > <label>My test th at can be edited</label> > > > > the above is you HTML markup. > > the text area is hidden and the label is shown. > > when the user clicks the label you would hide the label and show the text > > area. as well as focus on the textarea. > > when the users blurs from the text are or presses enter you hide the text > > are and show the label. however you update the label text. > > > > var obj = $(".editable"); > > var lbl = obj.next(); > > lbl.click(function() { > > lbl.hide(); > > obj.show(); > > obj.focus(); > > > > }); > > > > obj.blur(function() { > > lbl.text(obj.text()); > > obj.hide(); > > lbl.show()l; > > > > }); > > > > obj.keypress(function(e) { > > if(e.which == 13) { > > lbl.text(obj.text()); > > obj.hide(); > > lbl.show()l; > > } > > > > }); > > On Sat, Jan 16, 2010 at 7:45 AM, Izad CM <iza...@gmail.com> wrote: > > > Hi guys. I'm a jQuery newbie and naturally I have a question. :) > > > > > What's the best way to do real-time AJAX calls? I'm developing a web > > > app that has a functionality which is somewhat similar to Google > > > Wave's "real-time blip editing feature". Well, you know that thing > > > where we can see the blip being edited by someone else in real-time? > > > That's the thing I'm referring to. > > > > > What's the best way to do that? One think that I can think of is to do > > > periodic ajax calls using setTimeout() or setInterval(), but I'm not > > > sure if that's the standard way of doing this. Can someone point me in > > > the right direction? Thanks. > -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/