Interface ScriptElement

All Superinterfaces:
DomQueryable, Element, EventTarget, Node

public interface ScriptElement extends Element
Script element for adding functionality to Delphi pages with JavaScript.

Notes

  • Once a script element is added, it will be executed immediately. Unless the DOM is currently being loaded, and isDeferred() returns true.
  • Removing a script element from the DOM tree does nothing. Similarly, removing its content or its src attribute after the script has been loaded and executed also does nothing.
  • The JavaScript VM is only closed when the page is closed.
  • JavaScript support needs to be explicitly enabled by going to /plugins/Delphi/data/scripting.properties and setting enabled to true
  • Method Details

    • getSource

      @Nullable @Nullable String getSource()
      Get the script source.

      Shorthand for accessing the Attributes.SOURCE attribute.

      Returns:
      Script source
    • getSourcePath

      @Nullable @Nullable ResourcePath getSourcePath()
      Get the full source path of the script source file.
      Returns:
      Script source path
    • isDeferred

      boolean isDeferred()
      Get the value of the Attributes.DEFER attribute.
      Returns:
      true, if the defer attribute was set to true, false otherwise.