I'm writing a chat application as part of a project which is a sort of IRC/forum crossover in the sense that the chat updates in realtime but the feed is saved in my MySQL database.
This is only my second time using jQuery and I just wanted to check I'm on the right lines before I start researching further.
So this calls the jQuery function:
<form id="chatform" action="javascript:get();">
<input type="text" id="chatbox" name="chatbox">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/chat.js"></script>
</form>
My PHP should:
- Find all the variables (User ID, timestamp, message etc).
- Input these values into the database.
- Echo a all of the chat messages with everything correctly aligned.
My jQuery should:
- Display the new message in realtime by fading in:
element.fadeIn(500);
Is this all good or am I missing anything?