class dom::Win
sys::Obj dom::Win
@Js
Win models the DOM window object.
See pod doc for details.
- alert
-
Display a modal message box with the given text.
- close
-
Win close()
Close this window. Only applicable to windows created with
open
. Otherwise method has no effect. Returns this. - cur
-
const static Win cur()
Return the current window instance.
- doc
-
Doc doc()
Return the Doc instance for this window.
- hisBack
-
Void hisBack()
Go to previous page in session history.
- hisForward
-
Void hisForward()
Go to next page in the session history.
- hisPushState
-
Void hisPushState(Str title, Uri uri, Str:Obj map)
Push a new history item onto the history stack. Use
onpopstate
to listen for changes:// Event.meta contains state map passed into pushState Win.cur.onEvent("popstate", false) |e| { echo("# state: $e.meta") }
- hyperlink
-
Hyperlink to the given Uri in this window.
- localStorage
-
Storage localStorage()
Return local storage instance for window.
- onEvent
-
Void onEvent(Str type, Bool useCapture, |DomEvent| handler)
Attach an event handler to the given event on this element.
- open
-
const static Win open(Uri uri := `about:blank`, Str? winName := null, [Str:Str]? opts := null)
Open a new window. Returns the new window instance.
- reload
-
Void reload(Bool force := false)
Reload the current page. Use
force
to bypass browse cache. - sessionStorage
-
Storage sessionStorage()
Return session storage instance for window.
- uri
-
Uri uri()
Get the Uri for this window.
- viewport
-
Size viewport()
Return the size of the window viewport in pixels.