Module Dom.Location

Module representing location.

General structure of an url or uri:

        https://example.com:8042/over/there?name=ferret#nose
        \___/   \______________/\_________/ \_________/ \__/
          |            |            |            |        |
        scheme     authority       path        query   fragment
type t
val href : t -> string

The full url string of the location.

val protocol : t -> string

The protocol i.e. either http or https.

val host : t -> string

The host name i.e. the part of the authority before the port.

val port : t -> string

Port number as a string. If there is no explicit port, then the empty string is returned.

val pathname : t -> string

An initial '/' followed by the path of the url of the location (or an empty string if there is no path).

The query string.

val hash : t -> string

The fragment part of the url.

val assign : string -> t -> unit

assign url window Load the url.

val reload : t -> unit

Reload the current page.