开发者

Why is the JS code for Facebook's like button using a weird URL?

开发者 https://www.devze.com 2023-04-12 13:52 出处:网络
Looking at the code generated by the developers page, I\'m talking about this line: js.src = \"//connect.facebook.net/en_US/all.js#xfbml=1\";

Looking at the code generated by the developers page, I'm talking about this line:

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

It's such a weird URL, isn't it? I mean, the开发者_如何学C "right" way would be

js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";

Is there any benefit of omitting http:? Is it even a valid URL?


It will default to http or https depending on how the main page is loaded and not give mismatch errors.

0

精彩评论

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

关注公众号