简体   繁体   English

两个网址之间双斜线的目的是什么?

[英]What is the purpose of double slashes between two urls

I hope this isn't a dumb question but I came across this in a webpage and I am not sure what this means. 我希望这不是一个愚蠢的问题,但我在网页上遇到过这个问题,我不确定这意味着什么。

Here is the line of code I am referring to: 这是我所指的代码行:

http://www.cnn.com/http://z.cdn.turner.com/cnn/tmpl_asset/static/www_homepage/2596/css/hplib-min.css

What is the purpose of the the first part of this link. 这个链接第一部分的目的是什么? Why not just use the the second part, which is the actual pointer to the css file? 为什么不直接使用第二部分,这是指向css文件的实际指针?

There isn't a double slash between two urls. 两个网址之间没有双斜杠。 It is parsed as one (odd*) URL which in fact resolves to a 404 error. 它被解析为一个(奇数*)URL,实际上解析为404错误。

Either this is done in error, eg because a templating system automatically appends the base URL, or (less likely) this is an attempt to defeat adblockers, by having the link come down with the base url, and javascript then massage it, and presumably load the resource afterwards. 这可能是错误的,例如因为模板系统自动附加基本URL,或者(不太可能)这是尝试击败广告拦截器,通过使用基本网址链接,然后javascript然后按下它,并且可能是之后加载资源。

* Brad, in comments argues that it is invalid. *布拉德在评论中辩称它无效。 Maybe so (I'm not convinced), but in practice browsers will properly encode it for transmission. 也许是这样(我不相信),但实际上浏览器会对其进行正确编码以进行传输。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM