Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
//和http之间的区别://_Http_Url_Https_Protocols - Fatal编程技术网

//和http之间的区别://

//和http之间的区别://,http,url,https,protocols,Http,Url,Https,Protocols,我知道HTTP是超文本传输协议,我知道人们访问网站的方式(连同HTTPS)。然而,仅仅是一个/做什么呢?例如,要访问Google的jQuery副本,可以使用url//ajax.googleapis.com/ajax/libs/jQuery/1.10.2/jQuery.min.js,而不是http://... 到底有什么区别?刚才的/说明了什么 谢谢。通过在/上说,这意味着使用您的用户当前使用的任何协议(即:http vs https)来获取该资源 因此,您不必担心自己处理http:vs http

我知道
HTTP
是超文本传输协议,我知道人们访问网站的方式(连同
HTTPS
)。然而,仅仅是一个
/
做什么呢?例如,要访问Google的jQuery副本,可以使用url
//ajax.googleapis.com/ajax/libs/jQuery/1.10.2/jQuery.min.js
,而不是
http://...

到底有什么区别?刚才的
/
说明了什么


谢谢。

通过在
/
上说,这意味着使用您的用户当前使用的任何协议(即:http vs https)来获取该资源

因此,您不必担心自己处理http:vs https:management

避免潜在的浏览器安全警告。坚持这种做法是一种良好的做法


例如:如果您的用户正在访问
http://yourdomain/
该脚本文件将自动被视为
http://ajax.googleapis.com/...

如果您当前的请求是http

//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js 
//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js 
将被视为

http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
 https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

如果您当前的请求是https

将被视为

http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
 https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

谢谢很好的回答,回答正确。可能是重复的