Why does an anchor tag's href values need http:// preprended to the URL?

前端 未结 4 1864
感动是毒
感动是毒 2020-12-01 12:29
click here

Clicking the above link on a site\'s HTML page would try to take the

4条回答
  •  醉话见心
    2020-12-01 12:54

    Because the URL could have any number of protocols:

    The browser doesn't know if you mean ftp://www.stackoverflow.com, http://www.stackoverflow.com or whatever, so you need to specify.

提交回复
热议问题