例如链接图像:
<img src="//domain.com/img.jpg" />
代替:
<img src="http://domain.com/img.jpg" /> or <img src="https//domain.com/img.jpg" />
在我的测试中,我没有看到任何建议这是错误的,但我不知道如果它有边缘的情况下会造成问题.
编辑我看到它使用PHP的getimagesize功能时丢失错误.
解决方法
You have to be careful to only use
this Syntax in pages destined for
browsers. If you put it in an email,
there will be no base page URL to use
in resolving the relative URL. In
Outlook at least,this URL will be
interpreted as a Windows network file,
not what you intended.
从here
本质上,只要请求是由浏览器而不是外部电子邮件客户端,这不是有效的原因.
更多信息从here:
A relative URL without a scheme (http:
or https:) is valid,per RTF 3986:
Section 4.2. If a client chokes on it,
then it’s the client’s fault because
they’re not complying with the URI
Syntax specified in the RFC.Your example is valid and should work. I’ve used that relative URL method myself on heavily trafficked sites and have had zero complaints. Also,we test our sites in Firefox,Safari,IE6,IE7 and Opera. These browsers all understand that URL format