This documentation is the working space for the next version of the Infusion code and is being updated to reflect ongoing changes. As a result, it may contain information that is not relevant to the latest release, 1.4. For documentation related to v1.4 and earlier, please see the Infusion v1.4 Documentation.

If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki

Skip to end of metadata
Go to start of metadata

fluid.container(containerSpec, fallible)

Fetches a single container element and returns it as a jQuery.

File name: Fluid.js

Parameters

containerSpec (String|jQuery|Element) An id string, a single-element jQuery, or a DOM element specifying a unique container.
fallible (Boolean) (optional) If true, an empty container is to be reported as a valid condition (default: false).

Return Value

jQuery a single-element jQuery of specified container
null if no element is found and fallible is true

See Also


Notes

  • If fallible is not specified or is false, fluid.container() will throw an error if the specified DOM node is not found.

Examples

In both of these examples, fluid.container() returns a jQuery object that wraps the DOM node with an id of "menu-content." In both cases, if the node is not found, an error will be thrown.

In both of these examples, fluid.container() returns a jQuery object that wraps the DOM node with a class of "autocomplete-container." In both cases, more than one such node is found, an error will be thrown.

In this examples, if no node in the DOM has an id of "no-such-id," fluid.container() will not throw an error since the second argument is true: the return value will simply be null.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.