Dart API Referencedart:htmlLocation

Location Interface

Returns a Location object, which contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL.

Methods

Code void assign(String url) #

Load the document at the provided URL.
void assign(String url);

Code void reload() #

Reload the document from the current URL. forceget is a boolean, which, when it is true, causes the page to always be reloaded from the server. If it is false or not specified, the browser may reload the page from its cache.
void reload();

Code void replace(String url) #

Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.
void replace(String url);

Code String toString() #

Returns the string representation of the Location object's URL. See the JavaScript reference for details.
String toString();

Fields

Code final List<String> ancestorOrigins #

final List<String> ancestorOrigins;

Code String hash #

the part of the URL that follows the # symbol, including the # symbol.
You can listen for the hashchange event to get notified of changes to the hash in supporting browsers.
String hash;

Code String host #

the host name and port number.
String host;

Code String hostname #

the host name (without the port number or square brackets).
String hostname;

Code String href #

the entire URL.
String href;

Code final String origin #

final String origin;

Code String pathname #

the path (relative to the host).
String pathname;

Code String port #

the port number of the URL.
String port;

Code String protocol #

the protocol of the URL.
String protocol;
the part of the URL that follows the ? symbol, including the ? symbol.
String search;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.