且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

URL 中是否允许使用冒号?

更新时间:2023-11-27 11:52:52

URI 路径中允许有冒号.但是在使用冒号写入相对 URI 路径时需要小心,因为这样使用时是不允许的:

Colons are allowed in the URI path. But you need to be careful when writing relative URI paths with a colon since it is not allowed when used like this:

<a href="tag:sample">

在这种情况下,tag 将被解释为 URI 的方案.相反,你需要这样写:

In this case tag would be interpreted as the URI’s scheme. Instead you need to write it like this:

<a href="./tag:sample">