demo/amd/rjs/output/unified/marionette-build.js
function loadTemplate ( templateProperty ) {
        var $template;

        try {
            $template = $( templateProperty );

            // If the template is not in the DOM, treat the template property as a raw template string instead. That
            // part is handled in `catch`, and should not be guarded against further errors here. To switch to that
            // process, just throw an error.
            if ( !$.contains( document.documentElement, $template[0] ) ) throw new Error();
        } catch ( err ) {
            $template = _wrapRawTemplate( templateProperty );

            // If the template string cannot be retrieved unaltered even after wrapping it in a script tag, bail out by
            // throwing a silent error (will be caught, and not propagated further, in _createTemplateCache()).
            if ( $template.html() !== templateProperty ) throw new Error( "Failed to wrap template string in script tag without altering it" );
        }

        return $template;
    }
function loadTemplate ( templateProperty ) {
        var $template;

        try {
            $template = $( templateProperty );

            // If the template is not in the DOM, treat the template property as a raw template string instead. That
            // part is handled in `catch`, and should not be guarded against further errors here. To switch to that
            // process, just throw an error.
            if ( !$.contains( document.documentElement, $template[0] ) ) throw new Error();
        } catch ( err ) {
            $template = _wrapRawTemplate( templateProperty );

            // If the template string cannot be retrieved unaltered even after wrapping it in a script tag, bail out by
            // throwing a silent error (will be caught, and not propagated further, in _createTemplateCache()).
            if ( $template.html() !== templateProperty ) throw new Error( "Failed to wrap template string in script tag without altering it" );
        }

        return $template;
    }
Defines the default template loader. Accepts a selector string and returns the template node (usually a <script>
or <template> node) in a jQuery wrapper.

Is only ever called with a string argument. There is no need to handle other argument types here, or guard
against them.

Interprets the argument as a selector first and returns the corresponding node if it exists. If not, the argument
is interpreted as a raw HTML/template string and wrapped in a script tag (of type text/x-template). If the raw
template string contains a comment describing the el, the related data attributes are created on the script tag.

NB Raw template strings are never altered, and not interpreted (apart from looking for the el-related comment).

@param   {string} templateProperty
@returns {jQuery}