Relative urls vs Protocol-relative URLs -
i wondering if use relative url follows :
"/myfolder"
it change to
mydomain/myfolder
but maintain if root http or https similar "//"
approach.
i.e if page loading relative url "/myfolder" has https change to
"https://mydomain/myfolder"
tl;dr: yes.
relative references applied against base uri (see how).
in html5, document base url is, in common case (i.e., no base
element, no iframe
-srcdoc
document, no about:blank
), the document's address.
so if have document @ http://example.com/foo
, link relative reference /bar
link url http://example.com/bar
. , if document @ https://example.com/foo
, link https://example.com/bar
.
Comments
Post a Comment