Search:
Class o2.JsonpController
Extends
o2.AjaxController
A JSONP Controller
. Registers itself to JsonpState Observable
upon construction.
Implements the Observer
interface.
class
o2.JsonpController
Constructor Summary
See
http://download.oracle.com/javase/1.4.2/docs/api/java/util/Observer.html
Usage example:
var jsonp = o2.Jsonp.get('http://example.com/api.php', handleResponse); var controller = new o2.JsonpController(jsonp, {timeout: 5000});
Function Summary
override
unregister()
Overrides o2.AjaxController.unregister.
Unregisters this object from its associated observable. (i.e. JsonpState)
Usage example:
controller.unregister();
Constructor Details
constructor JsonpController
See
http://download.oracle.com/javase/1.4.2/docs/api/java/util/Observer.html
Usage example:
var jsonp = o2.Jsonp.get('http://example.com/api.php', handleResponse); var controller = new o2.JsonpController(jsonp, {timeout: 5000});
Parameters:
jsonp
- the current jsonp unique identifier.
args
- an associative array in the form
{timeout:[timeoutInMilliSeconds], ontimeout: [function]}
both attributes are optional. Function Details
function unregister
override
unregister()
Overrides o2.AjaxController.unregister.
Unregisters this object from its associated observable. (i.e. JsonpState)
Usage example:
controller.unregister();
function update
override
update(JsonpState
observable, Object
data)
Parameters:
observable
- the Observable
state
object.
data
- parameters passed from the
Observable
to this Observer
.
See also: