jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans
Search:
 
Filters

static Class jsbeans

Implementation of base Object used as namespace

Methods

alias

void alias ( newBase )
If you find namespace annoying and verbose, you can use this method to define an alternative to jsbeans global Object.
Sample:
// before
jsbeans.string.trimLeft("   string to trim");
// call alias
jsbeans.alias("jsb");
// after
jsb.string.trimLeft("   string to trim");
Note that if {@param} newBase is null, empty or already defined this method will exit silently
Parameters:
newBase <String> a global variable used as alias for jsbeans global Object
Returns: void

define

static void define ( pckName )
Create a full qualified Object (namespace included) from a string
Parameters:
pckName <String>
Returns: void

load

static void load ( jsbean , [func] , [until] )
Loads a 'jsbean' appending the script tag at the head of current page.
An optional function, passed as second argument, may be invoked as callback after the jsbean has been loaded. It tries each 100 milliseconds for 5 seconds (configurable).
Parameters:
jsbean <String> jsbean's name.
[func] <Function> A callback fired after the jsbean has been loaded. Optional.
[until] <Integer> Maximum number of seconds to try invoking the callback. Optional (default: 5).
Returns: void


Copyright © 2016 Francesco Mele. All rights reserved.