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.
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!)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().
| type | ||
| callback |
| str |