SimileAjax/API

= SimileAjax =

This set of methods bootstraps the bootstraps, providing methods to parse URL based parameters and to set up further loading of scripts and styling over the network.

Code: http://api.simile-widgets.org/ajax/2.2.1/simile-ajax-api.js

Back to SimileAjax.

SimileAjax.loaded

 * Type: boolean
 * Default:
 * Description: Internal flag for whether all sub-components have been loaded.

SimileAjax.loadingScriptsCount

 * Type: int
 * Default:
 * Description: Internal counter for how many scripts have been loaded.

SimileAjax.error

 * Type: string
 * Default: undefined
 * Values:
 * Description: If set to, SimileAjax debugging uses the built-in error handling environment.  If anything else, SimileAjax takes over all error handling.

SimileAjax.params

 * Type: array
 * Default:
 * Description: Defaults for public interface to changing SimileAjax settings through the URL by which it was called. URL parameters matching the keys can be appended to the script that calls SimileAjax.

SimileAjax.version
Set in SimileAjax/Platform


 * Type: string
 * Default:
 * Description: Advertises version number of SimileAjax.

SimileAjax.jQuery
Set in SimileAjax/Platform


 * Type: object
 * Default:
 * Description: Given jQuery is loaded, assigns it here and takes over window context jQuery if not already defined.

SimileAjax.urlPrefix
Set by SimileAjax_urlPrefix

SimileAjax_urlPrefix
The underscore is correct.


 * Type: string
 * Default: undefined
 * Description: If set in calling context, predetermines the HTTP host and path where SimileAjax is found.

SimileAjax_onLoad
''The underscore is correct. Used in SimileAjax/Signal''


 * Type: string or function
 * Default: undefined
 * Description: A function to be run after all SimileAjax Javascript files have been loaded.

getHead
This method is not inside the SimileAjax namespace.


 * Arguments:
 * doc:
 * Returns:
 * Description: Locates the  element using DOM interaction.

SimileAjax.findScript

 * Arguments:
 * doc:
 * substring: string, the name of the script
 * Returns: string, or
 * Description: Returns the full URL of any  element in the head that partially matches the substring.

SimileAjax.includeJavascriptFile

 * Arguments:
 * doc:
 * url: string, The absolute URL of the file to include
 * onerror: string, A function definition for what to do if there's an error in loading the script
 * charset: string, The character set of the file
 * Returns:, The added script node
 * Description: Includes one Javascript file in a document.

SimileAjax.includeJavascriptFiles

 * Arguments:
 * doc:
 * urlPrefix: string, The URL host and path to prefix to each filename
 * filenames: array, A list of strings of relative filenames
 * Returns: Nothing; side effect modifies document
 * Description: Includes several Javascript files at once, making use of the signalling apparatus for judging when all have been loaded.

SimileAjax.includeCssFile

 * Arguments:
 * doc:
 * url: string, The absolute URL of the CSS file to include
 * Returns:, The added link node
 * Description: Includes on CSS file in a document.

SimileAjax.includeCssFiles

 * Arguments:
 * doc:
 * urlPrefix: string, The URL host and path to prefix to each filename
 * filenames: array, A list of strings of relative filenames
 * Returns: Nothing; side effect modifies document
 * Description: Includes several CSS files at once.

SimileAjax.prefixURLs

 * Arguments:
 * urls: array
 * urlPrefix: string
 * suffixes: array
 * Returns: Nothing; side effect modifies  argument
 * Description: Append into  each string in   after prefixing it with.

SimileAjax.parseURLParameters

 * Arguments:
 * url: string, The URL to parse, or location.href if undefined
 * to: object (optional), Object to extend with parsed parameters
 * types: object (optional), Object mapping keys to value types (String, Number, Boolean, or Array; String by default)
 * Returns: object, A key/value object whose keys are the query parameter names
 * Description: Parse out the query parameters from a URL.

Back to SimileAjax.