Namespace: HtmlUtils

Oracle® JavaScript Extension Toolkit (JET)
9.2.0

F30740-01

QuickNav

HtmlUtils

Version:
  • 9.2.0
Since:
  • 6.1.0
Module:
  • ojhtmlutils

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojhtmlutils'], function(HtmlUtils) {
 // Application should call API on HtmlUtils 
})
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

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

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.

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>