options object

 

A JSON object that specifies the success and optional error functions. It is used as a parameter in many methods of various objects. This object has the following JSON format:

{ 
      success: function(results) {
                                     function definition
                                 },
      error: function(err) {
                                function definition
                           }
 }

Remarks

Example

Here is a code sample that shows use of the options object as a parameter. In this example the error function is absent.

tableName.select(function() { return this.id.substring(2,5) })
.read(
    { success: function(results) { 
            if (results.length > 0) {
                console.log(results);
            } else {
                console.log('no results returned');
            }
        }});