HtmlWriter

module:most-web.html. HtmlWriter

HtmlWriter class represents a helper class for rendering HTML content.

Constructor

new HtmlWriter()

Source:

Methods

toString() → {String}

Source:
Returns:
Type
String

write(s) → {HtmlWriter}

Parameters:
Name Type Description
s String
Source:
Returns:
Type
HtmlWriter

writeAttribute(name, value) → {HtmlWriter}

Writes an attribute to an array of attributes that is going to be used in writeBeginTag function
Parameters:
Name Type Description
name String The name of the HTML attribute
value String The value of the HTML attribute
Source:
Returns:
Type
HtmlWriter

writeAttributes(obj) → {HtmlWriter}

Writes an array of attributes to the output buffer. This attributes are going to be rendered after writeBeginTag or WriteFullBeginTag function call.
Parameters:
Name Type Description
obj Array | Object An array of attributes or an object that represents an array of attributes
Source:
Returns:
Type
HtmlWriter

writeBeginTag(tag) → {HtmlWriter}

Parameters:
Name Type Description
tag String
Source:
Returns:
Type
HtmlWriter

writeEndTag() → {HtmlWriter}

Writes an end HTML tag (e.g
) based on the current buffered tags.
Source:
Returns:
Type
HtmlWriter

writeFullBeginTag(tag) → {HtmlWriter}

Writes a full begin HTML tag (e.g
).
Parameters:
Name Type Description
tag String
Source:
Returns:
Type
HtmlWriter

writeText(s) → {HtmlWriter}

Parameters:
Name Type Description
s String
Source:
Returns:
Type
HtmlWriter

writeTo(f)

Parameters:
Name Type Description
f function
Source: