I'm trying to implement a heartbeat in my B4J webpage that reconnects to the server in case the heartbeat fails (and thus the connection was lost meanwhile).
Have your JavaScript perform the heartbeat and have your server respond to the heartbeat so that your JavaScript knows it worked. If it fails to get a response after a certain amount of time, call