Package org.loboevolution.js
Interface Location
- All Known Implementing Classes:
LocationImpl
public interface Location
The location (URL) of the object it is linked to. Changes done on it are
reflected on the object it relates to. Both the Document and Window interface
have such a linked Location, accessible via Document.location and
Window.location respectively.
-
Method Summary
Modifier and TypeMethodDescriptionvoidNavigates to the given URL.getAncestorOrigins.getHash()Returns the Location object's URL's fragment (includes leading "#" if non-empty).getHost()Returns the Location object's URL's host and port (if different from the default port for the scheme).Returns the Location object's URL's host.getHref()Returns the Location object's URL.Returns the Location object's URL's origin.Returns the Location object's URL's path.getPort()Returns the Location object's URL's port.Returns the Location object's URL's scheme.Returns the Location object's URL's query (includes leading "?"voidreload()Reloads the current page.voidreload(boolean forcedReload) Deprecated.voidRemoves the current page from the session history and navigates to the given URL.voidsetHash.voidsetHost.voidsetHostname(String hostname) setHostname.voidsetHref.voidsetPathname(String pathname) setPathname.voidsetPort.voidsetProtocol(String protocol) setProtocol.voidsetSearch.
-
Method Details
-
getAncestorOrigins
DOMStringList getAncestorOrigins()getAncestorOrigins.
- Returns:
- a
DOMStringListobject.
-
getHash
String getHash()Returns the Location object's URL's fragment (includes leading "#" if non-empty).Can be set, to navigate to the same URL with a changed fragment (ignores leading "#").
- Returns:
- a
Stringobject.
-
setHash
setHash.
- Parameters:
hash- aStringobject.
-
getHost
String getHost()Returns the Location object's URL's host and port (if different from the default port for the scheme).Can be set, to navigate to the same URL with a changed host and port.
- Returns:
- a
Stringobject.
-
setHost
setHost.
- Parameters:
host- aStringobject.
-
getHostname
String getHostname()Returns the Location object's URL's host.Can be set, to navigate to the same URL with a changed host.
- Returns:
- a
Stringobject.
-
setHostname
setHostname.
- Parameters:
hostname- aStringobject.
-
getHref
String getHref()Returns the Location object's URL.Can be set, to navigate to the given URL.
- Returns:
- a
Stringobject.
-
setHref
setHref.
- Parameters:
href- aStringobject.
-
getOrigin
String getOrigin()Returns the Location object's URL's origin.- Returns:
- a
Stringobject.
-
getPathname
String getPathname()Returns the Location object's URL's path.Can be set, to navigate to the same URL with a changed path.
- Returns:
- a
Stringobject.
-
setPathname
setPathname.
- Parameters:
pathname- aStringobject.
-
getPort
String getPort()Returns the Location object's URL's port.Can be set, to navigate to the same URL with a changed port.
- Returns:
- a
Stringobject.
-
setPort
setPort.
- Parameters:
port- aStringobject.
-
getProtocol
String getProtocol()Returns the Location object's URL's scheme.Can be set, to navigate to the same URL with a changed scheme.
- Returns:
- a
Stringobject.
-
setProtocol
setProtocol.
- Parameters:
protocol- aStringobject.
-
getSearch
String getSearch()Returns the Location object's URL's query (includes leading "?" if non-empty).Can be set, to navigate to the same URL with a changed query (ignores leading "?").
- Returns:
- a
Stringobject.
-
setSearch
setSearch.
- Parameters:
search- aStringobject.
-
assign
Navigates to the given URL.- Parameters:
url- aStringobject.
-
reload
void reload()Reloads the current page. -
reload
Deprecated.reload.
- Parameters:
forcedReload- a boolean.
-
replace
Removes the current page from the session history and navigates to the given URL.- Parameters:
url- aStringobject.
-