>   > +:userID        # user arrived
>   > -:userID        # user left
>   > s:userID:text   # user said something
>   > But then, is JS any good at text parsing like this?
>
> Sure.
>
>   m = somestring.match(/([+\-s]):(\w+)(:(.*))?$/);
>   action = m[1];
>   userID = m[2];
>   text = m[4];

Though Javascript could do this, as you say, no problem, it would mean the
file loaded wasn't javascript.
It'd be text/plain, and then javascript would analyse it onload.
Doing this once a second wouldn't work out as an advantage, I don't think.

I also don't see much improvement between:

+:userID
-:userID
s:userID:text

and:

addUser('userid');
rmUser('userid');
addMsg('userid','string');

I know it was me that said you want to keep the bytes per refresh down, but
I don't see much point in doing it if it adds even more processing at the
client end each second.

G


Reply via email to