Live updating page through Comet

20 views
Skip to first unread message

Amiramix

unread,
Oct 3, 2012, 12:31:32 PM10/3/12
to zotonic-d...@googlegroups.com
I saw there is the stream scomp but can it be used to something more than Ajax? Is it possible to update a web page opened in a browser live through comet? E.g. changing a status of an element in a table shown on the page when it has changed on the server?

Andreas Stenius

unread,
Oct 3, 2012, 12:59:49 PM10/3/12
to zotonic-d...@googlegroups.com
Have a look at mod_signal.

With that you can trigger events (actions) in the browser from the back end.

It has come up a few times before on this list, but it really ought to be properly documented.. (which we are currently working on :)

2012/10/3 Amiramix <li...@gjunka.com>

Andreas Stenius

unread,
Oct 3, 2012, 1:03:03 PM10/3/12
to zotonic-d...@googlegroups.com
Ah, and if mod_signal doesn't do what you want, you can always update the page from the server using one of the update actions.

You can have a look at mod_chat for one way of achieving that from the back end.


//Andreas

2012/10/3 Amiramix <li...@gjunka.com>

Amiramix

unread,
Oct 3, 2012, 1:11:08 PM10/3/12
to zotonic-d...@googlegroups.com
Many thanks Andreas. That's what I needed. Would you be so kind and said a word or two regarding the other question I posted a few days ago about jQuery? What I am mainly interested in is if trying to replace jQuery is a bad idea altogether or if it rather hasn't been tried yet.

Andreas Stenius

unread,
Oct 4, 2012, 3:05:55 AM10/4/12
to zotonic-d...@googlegroups.com
Well, about replacing jQuery..

I haven't looked at it myself. It has been asked before, but I can't recall the reply given then, and didn't find it with a quick search, so it probably wasn't in a jQuery thread...

However, the back end doesn't really care, apart from some actions or custom tags[1] that generate java script using jQuery functionality.
So, replacing jQuery is possible, but you'd have to avoid functionality that relies on it, unless you adapt it to your alternative.
And on the client side, I'd say that is quite much work if you want to use all the bells and whistles that exists today.

//Andreas

[1] custom tags, also known as scomps. As a step in our documentation effort, we are replacing some terms that are either hard to understand or otherwise confusing.
Another term recently renamed are the webmachine resource handler, which are now known as controller.

2012/10/3 Amiramix <li...@gjunka.com>
Reply all
Reply to author
Forward
0 new messages