Module gamejs/utils/uri

Utilies for URI handling.

Functions


makeRelative (uri)

Make an absolute URI relative to document.location.href

Parameters

String uri

Returns

The relative URI or the unchanged URI if it's not possible to make it relative to the path of document.location.href.

match (uri)

Try to match an URI against a regex returning the following capture groups:
$1 = http              scheme
$2 = <undefined>       userInfo -\
$3 = www.ics.uci.edu   domain     | authority
$4 = <undefined>       port     -/
$5 = /pub/ietf/uri/    path
$6 = <undefined>       query without ?
$7 = Related           fragment without #

Parameters

String uri

resolve (uri, path)

Resolve path against URI.

Parameters

String uri
String path to resolve