javascript - PHP Ajax: Perform action when database is updated -


what want is, when new comes database, gets latest value entered , plays specific song depending on says.

for example, on computer, run website. else around world picked phone , clicked play song, song automatically play on devices running page. when chooses new song, song should change.

i have made several tries @ this, trying use setinterval in javascript updates , updates time expect.

i guess looking way track when database has been updated, solutions or code examples can use?

if understand right, can use push notifications. https://firebase.google.com/docs/notifications/

here's tutorial how set js client https://firebase.google.com/docs/cloud-messaging/js/client

in case won't have unnecessary requests server fetch updated. send push notification client , necessary actions on client side.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -