Page MenuHomeGitPull.it

class JX.HTML
Javelin Documentation ()

Upcast a string into an HTML object so it is treated as markup instead of plain text. See JX.$N for discussion of Javelin's security model. Every time you call this function you potentially open up a security hole. Avoid its use wherever possible.

This class intentionally supports only a subset of HTML because many browsers named "Internet Explorer" have awkward restrictions around what they'll accept for conversion to document fragments. Alter your datasource to emit valid HTML within this subset if you run into an unsupported edge case. All the edge cases are crazy and you should always be reasonably able to emit a cohesive tag instead of an unappendable fragment.

You may use JX.$H as a shortcut for creating new JX.HTML instances:

JX.$N('div', {}, some_html_blob); // Treat as string (safe)
JX.$N('div', {}, JX.$H(some_html_blob)); // Treat as HTML (unsafe!)

Tasks

Builtin Events

  • static listen(type, callback) — Listen for events emitted by this object instance. You can also use the static flavor of this method to listen to events emitted by any instance of this object.

String into HTML

No methods for this task.

HTML into Nodes

No methods for this task.

Other Methods

Methods

static listen(type, callback)
Inherited

JX.Base

Listen for events emitted by this object instance. You can also use the static flavor of this method to listen to events emitted by any instance of this object.

See also JX.Stratcom.listen().

Parameters
type
callback
This method is not documented.
Parameters
str
This method is not documented.
Defined
lib/DOM.js:85
Extends
JX.Base