Simple code to implement jquery timer.
Today, the project encountered a message module, which is at the top of the navigation bar. I want to realize that when a message is received, it can be refreshed in time and display the message bar. After thinking about it for a long time, I thought of 2 methods,
1. Use the Ajax tag of struts2.
2. Use jquery.
struts2 is a bit troublesome, jquery is relatively simple. I used jquery. Paste the code below: Get data from the server every 3 seconds and assign it to the DOM object to be displayed.