开发者

jQuery chat application

开发者 https://www.devze.com 2023-03-12 10:00 出处:网络
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.

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开发者_JAVA技巧" 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?


I don't konw where your messages is saved.Is it be put in mysql.I don't think is a good place.Since that this messges may be useless after this time . and I think it should be seperated into two parts ,one is show messge ,and second is to tranfet message. the first is to get message from the back every some time. and the transfer part only work on the time you click the sending button.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号