onCmd event Ajax Pushe Engine

Algunas veces no se por que no cargan algunas páginas con los eventos de APE es por eso que si alguien tiene problemas de abrirlos aquí dejo una copia de onCmd:

Description
string onCmd ( string type, function fn )

Execute a function when a command is sent and pass to the function the arguments sent to APE server.


Parameters


type
Name of the command (e.g : 'connect', 'send');

fn
Callback function to execute
  • args - (object, optional) An object containing all data sent to the server.
  • pipe - (object, optional) If the request is made on a pipe (e.g : you sent data to a channel) the second argument will be a pipe object.

Examples


//ape var is a reference to APE instance 
//start(); method is used to connect to APE.
ape.start();

//Intercept connect command (connect command is used to initiate connection to APE server)

ape.onCmd('connect', function() {
console.log('Connect command sent');
});

Comentarios

Entradas populares de este blog

Jude Bellingham busca ganar 5 champions una Euro y tal vez un mundial.

Nissan March 2020 VS Chevrolet Spark 2020