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

The glow namespace and core library.

Includes common methods for running scripts onDomReady and user agent sniffing.

Properties

env

Information about the browser / platform

Type
Object

Properties

gecko
Gecko version number to one decimal place (eg 1.9) or NaN
ie
IE version number or NaN
khtml
KHTML version number to one decimal place or NaN
opera
Opera version (eg 8.02) or NaN
standardsMode
True if the browser reports itself to be in 'standards mode'
version
Browser version as a string. Includes non-numerical data, eg "1.8.1" or "7b"
webkit
Webkit version number to one decimal place (eg 419.3) or NaN

Example

if (glow.env.ie < 7) {
  //this only runs in IE 6 and below
}
if (glow.env.gecko < 1.9) {
  //this only runs in Gecko versions less than 1.9
  //Wikipedia can be used to link engine versions to browser versions
}
isReady

Is the DOM ready?

Type
Boolean

Description

Set to true when the DOM is ready. If the library is included after the DOM is loaded, you should manually set this to true.

isSupported

Set to true in supported user agents

Type
Boolean

Description

This will read false in 'level 2' browsers in BBC's Browser Support Guidelines

Further Info & Examples

VERSION

Version of glow

Type
String

Description

This is in the format 1.2.3

Further Info & Examples

Methods

onDomReady

Calls a function when/if the DOM is ready.

Synopsis

glow.onDomReady(callback);

Parameters

callback
Type
Function

Function to call

Returns

Description

Same as glow.ready but ignores glow.isSupported.

ready

Calls a function when/if the DOM is ready & the browser is supported

Synopsis

glow.ready(callback);

Parameters

callback
Type
Function

Function to call

Returns

Example

glow.ready(function() {
  alert("DOM Ready!");
});

Namespaces

anim

Simple and powerful animations.

data

Serialising and de-serialising data

dom

Accessing and manipulating the DOM

dragdrop

Simplifying drag and drop behaviour

embed

Detect and embed Flash objects

events

Native browser and custom events

forms

Validating HTML Forms

lang

Useful language functions.

net

Sending data to & from the server

tweens

Functions for modifying animations

widgets

Widget core module.

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

BBC © 2014 The 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.