Modifier and Type | Method and Description |
---|---|
void |
assign(String url)
Causes the window to load and display the document at the URL specified.
After the navigation occurs, the user can navigate back to the page that called Location.assign() by pressing the "back" button. |
String |
getHash()
Is a string containing a '#' followed by the fragment identifier of the URL.
|
String |
getHost()
Is a string containing the host, that is the hostname, a ':', and the port of the URL.
|
String |
getHostname()
Is a string containing the domain of the URL.
|
String |
getHref()
Is a stringifier that returns a string containing the entire URL.
If changed, the associated document navigates to the new page.It can be set from a different origin than the associated document. |
String |
getOrigin()
Returns a string containing the canonical form of the origin of the specific location.
|
String |
getParameter(String name)
Gets the URL parameter of the specified name.
Note that if multiple parameters have been specified with the same name, the last one will be returned. |
Map<String,List<String>> |
getParameterMap()
Returns an unmodifiable map of the URL query parameters for the host page at the time this method was called.
Any changes to the window's location will be reflected in the result of subsequent calls. |
String |
getPathname()
Is a string containing an initial '/' followed by the path of the URL.
|
String |
getPort()
Is a string containing the port number of the URL.
|
String |
getProtocol()
Is a string containing the protocol scheme of the URL, including the final ':'.
|
String |
getSearch()
Is a string containing a '?' followed by the parameters or "querystring" of the URL.
|
void |
reload()
Reloads the current URL, like the Refresh button.
|
void |
replace(String url)
Replaces the current resource with the one at the provided URL.
The difference from the assign(String) method is that after using replace(String) 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. |
@JsProperty public final String getHash()
@JsProperty public final String getHost()
@JsProperty public final String getHostname()
@JsProperty public final String getHref()
@JsProperty public final String getOrigin()
@JsProperty public final String getPathname()
@JsProperty public final String getPort()
@JsProperty public final String getProtocol()
@JsProperty public final String getSearch()
@JsMethod public final void assign(String url)
url
- new resource to set to URL@JsMethod public void reload()
@JsMethod public void replace(String url)
assign(String)
method is that after using replace(String)
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.url
- new resource to set to URL@JsOverlay public String getParameter(String name)
name
- the name of the URL parameternull
if missing@JsOverlay public Map<String,List<String>> getParameterMap()