Jaml-all.js
function(thisObj, data) {
    data = data || (thisObj = thisObj || {});
    
    //the 'data' argument can come in two flavours - array or non-array. Normalise it
    //here so that it always looks like an array.
    if (data.constructor.toString().indexOf("Array") == -1) {
      data = [data];
    }
    
    with(this) {
      for (var i=0; i < data.length; i++) {
        eval("(" + this.tpl.toString() + ").call(thisObj, data[i], i)");
      };
    }
    
    var roots  = this.getRoots(),
        output = "";
    
    for (var i=0; i < roots.length; i++) {
      output += roots[i].render();
    };
    
    return output;
  }
function(thisObj, data) {
    data = data || (thisObj = thisObj || {});
    
    //the 'data' argument can come in two flavours - array or non-array. Normalise it
    //here so that it always looks like an array.
    if (data.constructor.toString().indexOf("Array") == -1) {
      data = [data];
    }
    
    with(this) {
      for (var i=0; i < data.length; i++) {
        eval("(" + this.tpl.toString() + ").call(thisObj, data[i], i)");
      };
    }
    
    var roots  = this.getRoots(),
        output = "";
    
    for (var i=0; i < roots.length; i++) {
      output += roots[i].render();
    };
    
    return output;
  }
function ( thisObj , data ) { data = data || ( thisObj = thisObj || { } ) ; //the 'data' argument can come in two flavours - array or non-array. Normalise it //here so that it always looks like an array. if ( data . constructor . toString ( ) . indexOf ( "Array" ) == - 1 ) { data = [ data ] ; } with ( this ) { for ( var i = 0 ; i < data . length ; i ++ ) { eval ( "(" + this . tpl . toString ( ) + ").call(thisObj, data[i], i)" ) ; } ; } var roots = this . getRoots ( ) , output = "" ; for ( var i = 0 ; i < roots . length ; i ++ ) { output += roots [ i ] . render ( ) ; } ; return output ; }
Renders this template given the supplied data
@param {Object} thisObj Optional data object
@param {Object} data Optional data object
@return {String} The rendered HTML string
Renders this template given the supplied data