Re: how to push stuff to the browser
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.cherrypy |
|---|---|
| Organization | Providenza & Boekelheide, Inc. |
| Message-ID | <[email protected]> |
Andrew wrote: > > I am trying to design a text messaging service with cherrypy. > > Can someone give me some advice about how to push some notification to > the browser eg when there is a new message that arrives? > > I have tried to use yield statements, but I want to make like some box > start flashing or something when a message arrives, and I think I > cannot do this with yield statements. You cannot "push" anything to a browser. That's just not how the web works -- it is entirely a "pull" technology. Instead, the web page you send must have Javascript code that periodically polls your server to see if there is something new. You can do that with "refresh", but it's more common to use AJAX requests. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected] Visit this group at https://groups.google.com/group/cherrypy-users. For more options, visit https://groups.google.com/d/optout.