There\'s a function, which gives me urls like:
./some.css ./extra/some.css ../../lib/slider/slider.css
It\'s always a relative path.
The href solution only works once the document is loaded (at least in IE11). This worked for me:
link = link || document.createElement("a"); link.href = document.baseURI + "/../" + href; return link.href;
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base