Version 1.7 glow
API Quick Reference
JavaScript is required to use the quick reference
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
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 }
- isDomReady
-
Is the DOM ready?
- Type
Description
If glow is loaded after the page has loaded (by means other than Gloader) this value should be set manually.
- isReady
-
Is Glow ready?
- Type
Description
Set to true when Glow is ready. This includes DOM ready, a supported browser and any additional requirements. For example Glow widgets will add the loading of their CSS file as a requirement.
- isSupported
-
Set to true in supported user agents
- Type
Description
This will read false in 'level 2' browsers in ³ÉÈËÂÛ̳'s Browser Support Guidelines
Further Info & Examples
- UID
-
A unique ID for this instance of Glow
- Type
Description
This will be used in glow-specific property names that need to be unique to this instance of glow.
- VERSION
-
Version of glow
Methods
- onDomReady
-
Calls a function when / if the DOM is ready.
Synopsis
glow.onDomReady(callback);
Parameters
- callback
-
- Type
Function to call
Returns
Description
This function does not wait for glow's CSS to load, nor does it block unsupported browsers. If you want these features, use glow.ready
- ready
-
Calls a function when the DOM had loaded and the browser is supported
Synopsis
glow.ready(callback);
Parameters
- callback
-
- Type
Function to call
Returns
Description
"ready" also waits for glow's CSS file to load if it has been requested.
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.
- i18n
-
Internationalisation Module.
- lang
-
Useful language functions.
- net
-
Sending data to & from the server
- tweens
-
Functions for modifying animations
- widgets
-
Widget core module.