LoopBack Demo

This page demostrates a tight callback loop between the browser and server.

:Classloopback : MiPageSample⍝ Control:: _.Handler ⍝ Description:: Demonstration of tight client-server loopback started←0 ∇ Compose;f;list:Access public
Add_.h2'LoopBack Demo'Add'This page demostrates a tight callback loop between the browser and server.'_.br ⍝ add the button and a handler which will invoke Toggle on the callback (Add_.Button'Start/Stop').On'click''Toggle' ⍝ add a handler for the "ping" event which will invoke Pong on the callback Add_.Handler'body''ping''Pong' ⍝ add a container with id "output" to hold the result from the callback '#output'Add_.div ∇
∇ r←Toggle:Access public
started←~startedr←'' :If startedr←Execute'body'_JSS.Trigger'ping' :EndIf
∇
∇ r←Pong:Access public
r←'':Ifstartedr←'#output'Replace⍕⎕TSr,←Execute'body'_JSS.Trigger'ping':EndIf∇:EndClass