title: Resolving relative URLs in JavaScript
body: <p>I'm building a JS library which has a requirement of looking at form[action] and a[href] values and resolving them into absolute URLs.</p>
  <p>For example, I'm on http://a/b/c/d;p?q and encounter an href value of &quot;../g&quot; (assume there's no &lt;base&gt; element).  The resulting absolute would be: http://a/b/g.</p>
  <p>Is there a JS library that does this already?  I'd have to believe so.</p>
  <p>For more info about what's needed, the spec:
  <a href="https://www.rfc-editor.org/rfc/rfc3986#section-5.4" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc3986#section-5.4</a></p>