public
Description: PURE Unobtrusive Rendering Engine for HTML
Home | Edit | New

jQuery.compile

This is the method that will convert the HTML to a Javascript function.

$(html).compile( fName [, directives,  context ] )

Parameters:



fName

String

Is the name we want to give to the compiled template


Directives
(optional)

Object


This is the command…
Either a context or a directive or both need to be passed to have the template changed.


context
(optional)

Object


If we want to use the auto-rendering, the context needs to be passed for the compilation.

Output:


string
JS codeThe source code of the HTML template converted to the Javascript function is returned. The compiled function will be available at $p.compiledFunctions[fName].compiled

Note:

  • If no directives and no context are provided to the method, the outerHTML of the html template will be compiled as is.
  • See more information about compiling html template at optimize your response time
Last edited by pure, Tue Sep 16 04:13:22 -0700 2008
Home | Edit | New
Versions: