tldr
tldr

Reputation: 12112

Auto update option in Play! framework

How do I add an option for auto-update feature (like on Youtube and Twitter) using the play framework?

Specifically, if I was making a Stackoverflow clone, I'd want new questions to show up without having to refresh the page. Or, when viewing a question, new answers get added to the list without refreshing the entire page.

Thanks!

Upvotes: 2

Views: 405

Answers (1)

biesior
biesior

Reputation: 55798

You have two solutions, both possible without problems in Play!

  1. Use AJAX to send request for some period of time and check if there are new events for displayed page and the use ie. jQuery to update values of required eleements.
  2. StackOverflow as I can see uses websockets for updating vote counters, informing about edits, etc. It's reaaaaly powerful feature, but keep in mind that older browser can have some problems with it.

Upvotes: 2

Related Questions