• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
jQuery and CodeIgniter Chat Script

I was working with jQuery tonight and adapted a tutorial off of sitepoint that uses jQuery so that it works with codeigniter. It is a simple chat script where a person enters their name and a message.

Read more about the jQuery Chat script on my site. You have to go there to download it also, if you want to try it out.

You can see it working here. It will only store the last ten lines that people put in the chat. It uses MySQL to store the messages.

I couldn't figure out how to get the message in the input box to clear after you enter something. Maybe someone knows how?


I tried .remove() but that just deletes the input box. I think I am going to have to write a function to remove the value explicitly.


It's beginning to become a jQuery forum here, maybe there should be a jQuery section but then the other javascript/ajax library users would be jealous Smile

[eluser]CI Lee[/eluser]
That is pretty sweet... I think some sort of flood control is called for though.

Ok I updated it to version 1.2.

New Features:
# Keeps the focus on the message field.
# Removes what you typed previously.
# Loading animated gif after submitting.


Let me know if you have any more ideas.

[eluser]CI Lee[/eluser]
I like it! I may have a use for it in the not too distant future!



your welcome.

It is still not perfect. Sometimes it posts stuff 2x, but just to the msg field. I think it has to do with the query and how it handles time. I spent sometime trying to figure it out, but there is more debugging to be done before we find an acceptable solution.

It doesn't work exactly like the the sitepoint guy wanted. He thought it should only load messages posted after you load the page, but I don't mind that it loads everything, or the last ten messages. It is a minor thing that can be tweaked.

This may be helpful you.
CodeIgniter Chat example

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.