Script

public final class Script : GenericElement

This class define a Script element

Usage Example:

let script = Script()
script.add("var myJsVar = 1")

let script = Script(("src","myScript.js"))
  • tag

    Override tag element for option. Default is script

    Declaration

    Swift

    override var tag: String { get }
  • Override container element defaults is true

    Declaration

    Swift

    override var container: Bool { get }
  • This method add a text in script body element

    Declaration

    Swift

    public func add(_ text: String)

    Parameters

    text

    This is a content for tag text String