Please turn on JavaScript. To find out how to do this visit the WebWise JavaScript guide.

Returned by post, get async requests and loadScript

Constructor

new glow.net.Request()

Properties

complete

Boolean indicating whether the request has completed

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

Object

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
Type
glow.events.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
Type
glow.events.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
Type
glow.events.Event

Description

If you cancel the default (eg, by returning false) the request will continue.

Documentation generated by JsDoc Toolkit 2.1.0 on Mon Jul 06 2009 11:46:53 GMT+0100 (BST)

BBC © 2014The BBC is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.