Re: ajax question
- From: "E.J. Zufelt" <lists@xxxxxxxxx>
- To: programmingblind@xxxxxxxxxxxxx
- Date: Sat, 28 Mar 2009 23:40:38 -0300
Good evening,
I probably didn't do a very good job at explaining myself.
As you probably know, XML is the X in ajax. I would recommend that
new messages be sent to the browser via ajax as an xml object.
1. Ajax function requests new messages from the server.
2. Application on server processes the request and retrieves the
messages from wherever they are stored.
3. Application on server processes the new messages into an xml object
and returns it to the browser.
4. Javascript parses the xml and then can add each new message to the
list of current messages.
If you keep the messages in an unordered list then you can use
javascript to find out how many messages are in the list and remove
the oldest messages.
You may have thought of this already, but you can also use ARIA live
attributes on the html element which contains the chat history to
provide automatic announcement of new messages to users who have
assistive technology and browsers that support aria live updates.
hTH,
Everett
On 28-Mar-09, at 11:31 PM, Tyler Littlefield wrote:
hrm, I get the registering users, xml totally lost me. I'll have to
find a way of keeping it compact.
Possibly just see when the user last updated and then do somehting
with that.
Thanks,
Tyler Littlefield
Web: tysdomain.com
email: tyler@xxxxxxxxxxxxx
My programs don't have bugs, they're called randomly added features.
----- Original Message -----
From: E.J. Zufelt
To: programmingblind@xxxxxxxxxxxxx
Sent: Saturday, March 28, 2009 8:14 PM
Subject: Re: ajax question
Good evening,
How you will address these two issues will depend on how the backend
of your system is designed.
I would suggest that when the Ajax function requests the new chat
messages that they be received in XML format and be added to a list.
You can specify that only recent messages are sent to the browser
through ajax and you can then remove older messages from the list in
the browser.
As for channeling messages to the correct room / private recipient
you will need to have some functionality designed in the back end to
register users against channels or other users and when new messages
are requested a check is performed to determine which messages to
return to the browser.
HTH,
Everett
You can then remove older messages from the list when
On 28-Mar-09, at 12:52 PM, Tyler Littlefield wrote:
Hello list,
I've got a quick question.
I have the basic framework for a chat system in ajax, but I have
two questions regarding it.
First, I need a way to establish a session between one user and
another, or multiple users so that everyone doesn't see everyone
else's chat messages.
Also, I need a way to know what each person hasn't received, or
just update the page with the whole log rather than having
repetitions.
Ideas would be great.
Thanks,
Tyler Littlefield
Web: tysdomain.com
email: tyler@xxxxxxxxxxxxx
My programs don't have bugs, they're called randomly added features.
Other related posts: