Version 1.3 glow.net.Request
API Quick Reference
JavaScript is required to use the quick reference
Returned by post, get async requests and loadScript
Constructor
new glow.net.Request()
Properties
- complete
Boolean indicating whether the request has completed
- Type
- Boolean
- nativeRequest
The request object from the browser.
- Type
- Object
Description
This may not have the same properties and methods across user agents. Also, this will be undefined if the request originated from loadScript.
Methods
- abort
Aborts an async request
Synopsis
myRequest.abort();Returns
this
Description
The load & error events will not fire. If the request has been made using loadScript, the script may still be loaded but the callback will not be fired.
- send
Sends the request.
Synopsis
myRequest.send();Returns
This for async requests or a response object for sync requests
Description
This is done automatically unless the defer option is set
Events
- load
Fired when the request is sucessful
Synopsis
glow.events.addListener(myRequest, "load", function(event) { // ... });Arguments
- event
Description
For a get / post request, this will be fired when request returns with an HTTP code of 2xx. loadScript requests will fire 'load' only if {callback} is used in the URL.
- error
Fired when the request is unsucessful
Synopsis
glow.events.addListener(myRequest, "error", function(event) { // ... });Arguments
- event
Description
For a get / post request, this will be fired when request returns with an HTTP code which isn't 2xx or the request times out. loadScript calls will fire 'error' only if the request times out.
- abort
Fired when the request is aborted
Synopsis
glow.events.addListener(myRequest, "abort", function(event) { // ... });Arguments
- event
Description
If you cancel the default (eg, by returning false) the request will continue.