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 TypeMethodDescriptionvoid
Navigates 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 "?"void
reload()
Reloads the current page.void
reload
(boolean forcedReload) Deprecated.void
Removes the current page from the session history and navigates to the given URL.void
setHash.void
setHost.void
setHostname
(String hostname) setHostname.void
setHref.void
setPathname
(String pathname) setPathname.void
setPort.void
setProtocol
(String protocol) setProtocol.void
setSearch.
-
Method Details
-
getAncestorOrigins
DOMStringList getAncestorOrigins()getAncestorOrigins.
- Returns:
- a
DOMStringList
object.
-
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
String
object.
-
setHash
setHash.
- Parameters:
hash
- aString
object.
-
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
String
object.
-
setHost
setHost.
- Parameters:
host
- aString
object.
-
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
String
object.
-
setHostname
setHostname.
- Parameters:
hostname
- aString
object.
-
getHref
String getHref()Returns the Location object's URL.Can be set, to navigate to the given URL.
- Returns:
- a
String
object.
-
setHref
setHref.
- Parameters:
href
- aString
object.
-
getOrigin
String getOrigin()Returns the Location object's URL's origin.- Returns:
- a
String
object.
-
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
String
object.
-
setPathname
setPathname.
- Parameters:
pathname
- aString
object.
-
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
String
object.
-
setPort
setPort.
- Parameters:
port
- aString
object.
-
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
String
object.
-
setProtocol
setProtocol.
- Parameters:
protocol
- aString
object.
-
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
String
object.
-
setSearch
setSearch.
- Parameters:
search
- aString
object.
-
assign
Navigates to the given URL.- Parameters:
url
- aString
object.
-
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
- aString
object.
-