onRaw
(since )
Intercept a raw
Description
string
onRaw
(
string type, function fn )
Execute a function when a raw is received and pass to the function the data received from the server.
If the received raw is related to a pipe (e.g : you receive data from a channel) the second arguments will be a pipe object.
Parameters
type
Name of the raw (e.g : 'login', 'data');
fn
Callback function to execute
- args - (object, optional) An object containing all data sent by 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
//Intercept login raw.
ape.onRaw('login', function(param) {
alert('You are now connected to APE! with sessid' + param.data.sessid);
});
User notes
# No comment
Post a note
CollaborAPE to our wiki !
Find the information you need on the APE Official Wiki : Install, Server, JSF, Help...
