Document

class Document(receiver: WebBrowser) : EventGenerator<Document>

Represents the in-browser Document Object Model, corresponding to the JavaScript document object.

Passed in as doc to the buildPage lambda of the Kweb constructor.

Constructors

Document
Link copied to clipboard
fun Document(receiver: WebBrowser)

Functions

addEventListener
Link copied to clipboard
open override fun addEventListener(eventName: String, returnEventFields: Set<String>, retrieveJs: String?, preventDefault: Boolean, callback: (JsonElement) -> Unit): Document
addImmediateEventCode
Link copied to clipboard
open override fun addImmediateEventCode(eventName: String, jsCode: String)
body
Link copied to clipboard
fun body(new: ElementCreator<BodyElement>.() -> Unit? = null): BodyElement
execCommand
Link copied to clipboard
fun execCommand(command: String)
getElementById
Link copied to clipboard
fun getElementById(id: String): Element
getOrigin
Link copied to clipboard
suspend fun getOrigin(): Any
head
Link copied to clipboard
fun head(new: ElementCreator<HeadElement>.() -> Unit? = null): HeadElement
on
Link copied to clipboard
fun on(retrieveJs: String? = null, preventDefault: Boolean = false): OnReceiver<Document>
You can supply a javascript expression retrieveJs which will be available via Event.

Properties

body
Link copied to clipboard
val body: BodyElement
browser
Link copied to clipboard
open override val browser: WebBrowser
cookie
Link copied to clipboard
val cookie: CookieReceiver
head
Link copied to clipboard
val head: HeadElement
localStorage
Link copied to clipboard
val localStorage: StorageReceiver
Allows data to be stored in and retrieved from the browser's local storage.
on
Link copied to clipboard
val on: OnReceiver<Document>
See here.
onImmediate
Link copied to clipboard
val onImmediate: OnImmediateReceiver<Document>
See here.
receiver
Link copied to clipboard
val receiver: WebBrowser
sessionStorage
Link copied to clipboard
val sessionStorage: StorageReceiver
Allows data to be stored in and retrieved from the browser's session storage.