ACTION-135: Summarize the SuccessCallback patterns and use cases for each method (i.e. use Function or SuccessCallback(Message message))

Summarize the SuccessCallback patterns and use cases for each method (i.e. use Function or SuccessCallback(Message message))

State:
closed
Person:
Richard Tibbett
Due on:
March 25, 2010
Created on:
March 18, 2010
Associated Product:
APIs — General
Related emails:
  1. Draft F2F Minutes Day 3, 2010-03-18 (from frederick.hirsch@nokia.com on 2010-03-18)

Related notes:

The use of [Callback=FunctionOnly] on the callback interfaces defined is explained clearly in the WebIDL specification @ http://dev.w3.org/2006/webapi/WebIDL/#Callback.

A method implementing these callbacks will accept a function. According to the WebIDL spec, the following are valid:

navigator.service.contacts.find("name", function() { /* success callback */} );

navigator.service.contacts.find("name", function(contacts) { /* success callback */} );

navigator.service.contacts.find("name", function(contacts) { /* success callback occurs here... */ onsuccess: function() { /* ...not here */ } } );

The following is not valid:

navigator.service.contacts.find("name", { onsuccess: function() { /* throws a TypeError */ } } );

Richard Tibbett, 4 Oct 2010, 15:46:44

Display change log.


Anssi Kostiainen <anssi.kostiainen@intel.com>, Reilly Grant <reillyg@google.com>, Chairs, Fuqiao Xue <xfq@w3.org>, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: index.php,v 1.326 2018/10/13 17:29:51 vivien Exp $