shorthand http:// as // for script and link tags? anyone see / use this before?

前端 未结 2 1559
走了就别回头了
走了就别回头了 2020-11-27 22:10

the question is as follows:

if you take a look at any site using addthis (the share button)...

once you float over the addthis button, and all of the require

2条回答
  •  伪装坚强ぢ
    2020-11-27 22:21

    To build upon Quentin's answer, these URLs are commonly called protocol-less URLs (although, as Nick points out in the comments, the proper name is scheme-less).

    Also, be wary of the case where you use them in local development (i.e. linking to jQuery from an HTML page that you load from your hard disk, through the file:// protocol). In such scenarios, all outbound links will be treated as local ones - //jquery.com/ will refer to file://jquery.com/

提交回复
热议问题