Namespace: WJBRYANT

WJBRYANT

The WJBRYANT namespace. If the WJBRYANT object is already defined, it will not be overwritten. However, any properties or methods of the same name will be overwritten.
Source:

Namespaces

Ajax
Anim

Members

A reference to the document head.
Type:
  • Element
Source:

Methods

<static> addListener(obj, type, fn)

Registers an event listener in a cross-browser compatible way. Note that this only supports the DOM Level 2 and IE event registration models. If this method is called in a browser that does not support one of these models, it will do nothing. Based on the original code by Dean Edwards and Tino Zijdel (http://therealcrisp.xs4all.nl/upload/addEvent_dean.html) and also inspired by David Flanagan's Handler.js (http://www.davidflanagan.com/javascript5/display.php?n=17-2&f=17/Handler.js).
Parameters:
Name Type Description
obj Object the object on which to register the event
type string the type of event - Example: 'load' or 'mouseover'
fn Function the function to be executed when the event fires
Source:

<static> deleteCookie(name, path, domain)

Deletes a cookie by setting its value to nothing and its max-age to zero.
Parameters:
Name Type Argument Description
name string the name of the cookie to delete
path string <optional>
the path of the cookie to delete
domain string <optional>
the domain of the cookie to delete
Source:

<static> getCookie(name) → {string}

Gets the specified cookie's value.
Parameters:
Name Type Description
name string the name of the cookie to get
Source:
Returns:
the cookie value
Type
string

<static> loadScript(url, callback)

Dynamically loads a JavaScript file and executes the specified callback function when complete. See discussion of this technique at http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/
Parameters:
Name Type Argument Description
url string the source location of the script to load
callback Function <optional>
the function to execute when the script is loaded
Source:

<static> removeListener(obj, type, fn)

Unregisters an event listener in a cross-browser compatible way. Note that this only supports the DOM Level 2 and IE event registration models. If this method is called in a browser that does not support one of these models, it will do nothing. Based on the original code by Dean Edwards and Tino Zijdel (http://therealcrisp.xs4all.nl/upload/addEvent_dean.html) and also inspired by David Flanagan's Handler.js (http://www.davidflanagan.com/javascript5/display.php?n=17-2&f=17/Handler.js).
Parameters:
Name Type Description
obj Object the object on which the event is registered
type string the type of event - Example: 'load' or 'mouseover'
fn Function the function to be unregistered
Source:

<static> setCookie(name, value, expires, path, domain, secure)

Sets a cookie to the specified value. If no cookie exists, then it is created.
Parameters:
Name Type Argument Description
name string the name of the cookie
value string the value of the cookie
expires number <optional>
the number of days in which the cookie will expire
path string <optional>
the cookie path
domain string <optional>
the cookie domain
secure boolean <optional>
whether the cookie should only be sent over a secure connection
Source:

<static> trim(str) → {string}

Removes the leading and trailing whitespace from a string. (http://blog.stevenlevithan.com/archives/faster-trim-javascript)
Parameters:
Name Type Description
str string the string to trim
Source:
Returns:
the trimmed string
Type
string