join-uris
Join together a URI path to a base.
joinURIs(base, href)
Provides a convenient way to join together URIs handling relative paths.
var joinURIs = require("can-util/js/join-uris");
var base = "http://example.com/some/long/path";
var href = "../../images/foo.png";
var res = joinURIs(base, href);
console.log(res); // -> http://example.com/images/foo.png
Parameters
- base
{String}
: - href
{String}
:
Returns
{String}
:
The result of joining the two parts.