开发者

HTML, using a relative URL as a BASE URL?

开发者 https://www.devze.com 2022-12-25 09:35 出处:网络
Is it possible to set a base url on a page with a relative value? For example, I have two websites (website A and website B). For Website B it will be located at www.website-a.com/website-b. So could

Is it possible to set a base url on a page with a relative value?

For example, I have two websites (website A and website B). For Website B it will be located at www.website-a.com/website-b. So could I set the BASE href as '/webs开发者_Python百科ite-b/'?

Thanks


No, base URL can not be relative. The closest reference I found was RFC 1808: http://www.freesoft.org/CIE/RFC/1808/13.htm and W3C


Not possible according to W3C specs:

href = uri [CT]
This attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号