The URL interface represents an object providing static methods used for creating object URLs.

Documentation URL by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Static methods

staticcanParse(url:String, ?base:EitherType<String, URL>):Bool

Returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.

staticcreateObjectURL(source:MediaSource):String

staticcreateObjectURL(blob:Blob):String

Throws:

null

DOMError

staticparse(url:String, ?base:EitherType<String, URL>):Null<URL>

Returns a newly created URL object representing the URL defined by the parameters.

staticrevokeObjectURL(url:String):Void

Throws:

null

DOMError

Constructor

new(url:String, ?base:EitherType<String, URL>)

Throws:

null

DOMError

Variables

hash:String

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

host:String

Is a DOMString containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL.

hostname:String

Is a DOMString containing the domain of the URL.

href:String

Is a DOMString containing the whole URL.

read onlyorigin:String

Returns a DOMString containing the origin of the URL, that is its scheme, its domain and its port.

password:String

Is a DOMString containing the password specified before the domain name.

pathname:String

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

port:String

Is a DOMString containing the port number of the URL.

protocol:String

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

search:String

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

read onlysearchParams:URLSearchParams

Returns a URLSearchParams object allowing to access the GET query arguments contained in the URL.

username:String

Is a DOMString containing the username specified before the domain name.

Methods

toJSON():String

Returns a JSON representation of this URL.

toString():String

Returns a string representation of this URL.