GlideDocument - Client

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 2분
  • The GlideDocument API provides methods to search a Document Object Model (DOM) element, a document, or a JQuery element.

    You can use this API in client-side scripts using ListV2 and ListV3 APIs. The GlideDocument APIs are accessed using the g_document global object.

    GlideDocument - getElement(String selector, Element context)

    Returns a node found in the specified DOM based context or created from the HTML context.

    표 1. Parameters
    Name Type Description
    selector String or Object Selector expression
    context String or Object Optional. DOM Element, document, or JQuery object to search.
    표 2. Returns
    Type Description
    node Node that matches the selector.

    This example shows how to get the list view name value from a UI page.

    //HTML entry
    <input type="hidden" id="list_view" name="list_view" value="${sysparm_list_view}" />
    
    // Client script
    var listView = g_document.getElement('#list_view').value;

    GlideDocument - getElements(String selector, Element context)

    Returns a node list found in the specified DOM based context or created if an HTML context is specified.

    표 3. Parameters
    Name Type Description
    selector String or Object The selector expression
    context String or Object (Optional) A DOM Element, document, or JQuery object to be searched.
    표 4. Returns
    Type Description
    node list A list of nodes that matches the selector.