I'm writing a Python webserver and am wondering, do you respond to an ajax request like any other request (ie sending headers) ?

One more question, I am writing an ajax chat room (real simple one) and can't figure out how to refresh the chatroom for all users when a new message is typed. The only solution I can think of is to write some javascript that will send an ajax request every second or so to get any new messages.