request.on()

request.on(type[, listener])

If listener is specified, sets the event listener for the specified type and returns this request instance. If an event listener was already registered for the same type, the existing listener is removed before the new listener is added. If listener is null, removes the current event listener for the specified type (if any) instead. If listener is not specified, returns the currently-assigned listener for the specified type, if any.

The type must be one of the following:

  • beforesend - to allow custom headers and the like to be set before the request is sent.
  • progress - to monitor the progress of the request.
  • load - when the request completes successfully.
  • error - when the request completes unsuccessfully; this includes 4xx and 5xx response codes.

To register multiple listeners for the same type, the type may be followed by an optional name, such as load.foo and load.bar. See d3-dispatch for details.

doc_D3_Js
2016-11-24 10:28:46
Comments
Leave a Comment

Please login to continue.