if_on_client

The ifonclient statement performs the statement block if the code ends up lying on the client. It does not affect the decision making as to weather or not the code will be placed on the client, but simply reacts to it. In most cases, ifonclient will be paired with and ifonserver statement in order to specify how to perform the same action in either location using explicit code In other cases, the user may wish to make sure that the performance of a piece of code whould not affect the location decision.

Format:

ifonclient { [statements] }

Examples

if_on_client {
      JS< console.log("testpoint 1"); >JS
 }
// sleep one second no matter where we are
if_on_client {
   JS<P new Promise(function(resolve,reject){  setTimeout(resolve,1000); }) >JS
}
if_on_server {
   PHP< sleep(1); >PHP
}