Location

@native @JSType
trait Location extends Object

The Location interface represents the location 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.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def assign(url: String): Unit

The Location.assign()method loading the object at the URL providing in parameter.

The Location.assign()method loading the object at the URL providing in parameter.

def origin: String

The origin read-only property is a String containing the Unicode serialization of the origin of the represented URL, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitly specified). For URL using file: scheme, the value is browser dependant.

The origin read-only property is a String containing the Unicode serialization of the origin of the represented URL, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitly specified). For URL using file: scheme, the value is browser dependant.

def reload(): Unit

Reloads the resource from the current URL, like the Refresh button. The reload may be blocked and a SECURITY_ERROR DOMException thrown. This happens if the origin of the script calling location.reload() differs from the origin of the page that owns the Location object.

Reloads the resource from the current URL, like the Refresh button. The reload may be blocked and a SECURITY_ERROR DOMException thrown. This happens if the origin of the script calling location.reload() differs from the origin of the page that owns the Location object.

def replace(url: String): Unit

The Location.replace()method replaces the current resource 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.

The Location.replace()method replaces the current resource 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.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

var hash: String

Is a DOMString containing a '#' followed by the fragment identifier of the URL.

Is a DOMString containing a '#' followed by the fragment identifier of the URL.

var host: String

Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL.

Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL.

var hostname: String

Is a DOMString containing the domain of the URL.

Is a DOMString containing the domain of the URL.

var href: String

Is a DOMString containing the whole URL.

Is a DOMString containing the whole URL.

var pathname: String

Is a DOMString containing an initial '/' followed by the path of the URL.

Is a DOMString containing an initial '/' followed by the path of the URL.

var port: String

Is a DOMString containing the port number of the URL.

Is a DOMString containing the port number of the URL.

var protocol: String

Is a DOMString containing the protocol scheme of the URL, including the final ':'.

Is a DOMString containing the protocol scheme of the URL, including the final ':'.

var search: String

Is a DOMString containing a '?' followed by the parameters of the URL.

Is a DOMString containing a '?' followed by the parameters of the URL.