Auto Refresh a div section with jQuery ajax call every ten seconds.

I am building a "chat" section for a small web page I'm working on.

I uses php, jQuery, mySQL...

Any recommendations regarding a nice way to do this?

I want it to go out every ten seconds or so to check the DB to see if there is any new postings in a message text section.
Or is there a way to have it "push" out new notifications to any Website currently connected.

Any ideas of how to approach this would be great.  Thanks.


I'm also open to any other
Paul KonstanskiProject SpecialistAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
There are many ways to skin this cat. A method for doing it the way you describe is comprehensively discussed here (http://code.tutsplus.com/tutorials/how-to-create-a-simple-web-based-chat-application--net-5931)

There are plugins you can use such as Converse (https://conversejs.org/)

If you want to know more about chat servers do a search for XMPP

Also take a look at Jabber (https://conversejs.org/)

Other options include using NodeJS (http://nodejs.org) with something like SocketIO (http://socket.io/get-started/chat/)

More information on how to create a chat application with NodeJS (http://tutorialzine.com/2014/03/nodejs-private-webchat/)

That should get you going in the right direction.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Slick812Commented:
greetings pkonstan1, ,  Doing your own browser - PHP Chat "communication system" is not an easy thing to do, and can be very time consuming, because I have helped to assemble such a system and There are many things (page refresh, security [posting as another user], angry user post flooding, detecting when a user is gone, etc.) that come up in the testing phase, having several many people to test it out. But there are many php chat systems now available that are already set up and have been tested, that you can use. As Julian has suggested. BUT, you should take the time to go through a couple of php-chat coding tutorials, because you should try and learn what features (not just visual appearance) you want-need in the chat you will use, and the tutorials can let you understand what some of the operations are for chat systems so you can deal better with the many factors that chat systems can have.
You might look at this tut page -
    https://css-tricks.com/jquery-php-chat/
4 a tutorial.

A current php chat system is here - http://www.phpopenchat.org/
I do not recommend or approve of that one, but it is current, , , as many php chat systems are 5 and even 10 years since the last update.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.