Experts Exchange > Questions > Refreshing JSP codes to check for data updates without refreshing the entire browser(eg. does not affect a user reading a article while constantly refreshing in the backgrd)
Hi.. I have a urgent question. Basically I have this site written in JSP that allows one computer to send a "instant message" to another computer(both at a specific webpage of my site). The message sent is first stored in a vector/file/db and then retrieved when computer B(reciever) refreshes the page and the codes check that boolean newMsg=true; and displays the message in a Alert box.
My problem is, the reciever has to manually click refresh to check for any new messages. What I need is for the "refresh" to somehow.. run (in the background?) without disturbing the reciever(perhaps reading a article). And when a new message is detected, the Alert box will pop up.
Hope I make this clear enough. Please help! Thanks!
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX.
The logical flow for the problem should be:
Write an event handler for the first drop down box to get …
Since I wrote the original article about
Handling Date and Time in PHP and MySQL
several years ago, it seemed like now was a good time to update it for object-oriented PHP. This article does that, replacing as much as possible the pr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing.
Set up your basic HTML file. Open your form tag and set the method and action attributes.:
Set up your first few inputs one for the name and …