Check if URL is Absolute

Published on

Last updated on

Returns true if the URL is an absolute URL.

function isAbsolute(url) { return /^https?:\/\//.test(url); }

Learn more about the difference between absolute and relative URLs.