Due: 9 Mar 2012, 11:59pm
AbstractIn this assignment, you will be using AJAX to add more functionality to your chat application. To save time, you should continue to use your chat system from Assignment 10. If you were not able to finish either assignment or would prefer to not use your solution, you may use the Instructor Solutions as a starting point.
AssignmentThe following changes should be made to your solution from Assignment 10:
When asking the server for new messages, you can use the messageid column to help communicate which messages you already have. You might want another PHP file to help with getting messages.
To prevent a form from submitting, you can set an onsubmit handler to a function that returns false, for example:
document.getElementById("myform").onsubmit = function() { .... return false; }or, using jQuery:
$("#myform").submit(function() { .... return false; });
To add the AJAX functionality for sending messages while still letting the form POST normally (for users without JavaScript), run code inside your window.onload handler to attach the functionality to your page. This way, users without JavaScript won't run the window.onload code and therefore won't attempt the AJAX functionality.
You can use window.setInterval to specify a function to run periodically.
NotesYou may use jQuery for this assignment. It is recommended, but not required.
To ConsiderThis is not part of the assignment. When you are done, think about ways that you might implement a "logged in users" list on the side of the chat history box, showing who all is currently using the chat room.
Homework SubmissionAs detailed on the homework submission page, this homework must be on the class web server in a folder titled homework12 for it to be graded.