Struct stdweb::web::Window
[−]
[src]
pub struct Window(_);
The Window
object represents a window containing a DOM document.
Methods
impl Window
[src]
fn alert(&self, message: &str)
The Window.alert() method displays an alert dialog with the optional specified content and an OK button.
fn local_storage(&self) -> Storage
The local_storage
property allows you to access a local Storage
object.
It is similar to the Window::session_storage.
The only difference is that, while data stored in local_storage
has
no expiration time, data stored in session_storage
gets cleared when
the browsing session ends - that is, when the browser is closed.
fn session_storage(&self) -> Storage
The session_storage
property allows you to access a session Storage
object for the current origin.
It is similar to the Window::local_storage,
The only difference is that, while data stored in local_storage
has
no expiration time, data stored in session_storage
gets cleared when
the browsing session ends.
A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated, which differs from how session cookies work.
fn location(&self) -> Option<Location>
Returns a Location object which contains information about the URL of the document and provides methods for changing that URL and loading another URL.
Trait Implementations
impl IEventTarget for Window
[src]
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandle where
T: ConcreteEvent,
F: FnMut(T) + 'static,
T: ConcreteEvent,
F: FnMut(T) + 'static,
Adds given event handler to the list the list of event listeners for the specified EventTarget
on which it's called. Read more
impl IWindowOrWorker for Window
[src]
fn set_timeout<F: FnOnce()>(&self, callback: F, timeout: u32)
Sets a timer which executes a function once after the timer expires. Read more
impl Debug for Window
[src]
impl Clone for Window
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl AsRef<Reference> for Window
[src]
impl<T: TryInto<Reference>> TryFrom<T> for Window where
T::Error: Into<Box<Error>>,
[src]
T::Error: Into<Box<Error>>,