Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:html
  3. Element
  4. setInnerHtml method
setInnerHtml
description

setInnerHtml method

voidsetInnerHtml(
  1. String?html, {
  2. NodeValidator?validator,
  3. NodeTreeSanitizer?treeSanitizer,
})

Parses the HTML fragment and sets it as the contents of this element.This ensures that the generated content follows the sanitization rulesspecified by the validator or treeSanitizer.

If the default validation behavior is too restrictive then a newNodeValidator should be created, either extending or wrapping a defaultvalidator and overriding the validation APIs.

The treeSanitizer is used to walk the generated node tree and sanitize it.A custom treeSanitizer can also be provided to perform special validationrules but since the API is more complex to implement this is discouraged.

The resulting tree is guaranteed to only contain nodes and attributes whichare allowed by the provided validator.

See also:

Implementation

void setInnerHtml(  String? html, {  NodeValidator? validator,  NodeTreeSanitizer? treeSanitizer,}) {  text = null;  if (treeSanitizer is _TrustedHtmlTreeSanitizer) {    _innerHtml = html;  } else {    append(      createFragment(        html,        validator: validator,        treeSanitizer: treeSanitizer,      ),    );  }}
  1. Dart
  2. dart:html
  3. Element
  4. setInnerHtml method
Element class

[8]ページ先頭

©2009-2025 Movatter.jp