Namespace: HtmlUtils

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 6.1.0
Module:
  • ojhtmlutils

QuickNav

Description

Utility class with functions for preprocessing HTML content.

Note, the utility methods do not validate HTML input provided by an application for integrity or security violations. It is the application's responsibility to sanitize the input to prevent unsafe content from being added to the page.


Usage

Typescript Import Format
//This namespace exports multiple static methods or members. To import 
import * as HtmlUtils from "ojs/ojhtmlutils";

//Now you can access the methods as HtmlUtils.methodName and so on

For additional information visit:


Methods

(static) .getTemplateContent(node) : {Array.<Node>}

Utility that will clone the content of a template node and return an array of DOM Nodes.
Parameters:
Name Type Description
node Node The template node to retrieve the content for.
Returns:
Type
Array.<Node>

(static) .stringToNodeArray(html) : {Array.<Node>}

Utility that will parse an HTML string into an array of DOM Nodes.
Parameters:
Name Type Description
html string The HTML string to parse.
Returns:
Type
Array.<Node>