0

I could only find answers about http and https comparison but I would like to ask: Is there any difference if I will use in code // rather than https://? (In addition to reducing the code)

For example:

<a href="//website.com">test></a>

And:

<a href="https://website.com">test></a>
toraritte
  • 6,300
  • 3
  • 46
  • 67
  • See https://stackoverflow.com/questions/20523318/is-a-url-with-in-the-path-section-valid and specially https://stackoverflow.com/questions/743247/types-of-urls – flen Jul 07 '18 at 05:01

2 Answers2

1

In a URL, // means "current protocol"; either http or https depending on which you're currently using.

wizzwizz4
  • 6,140
  • 2
  • 26
  • 62
1

Just to be crystal clear, the difference between using // rather than https:// is that the second specifies the protocol (https), whereas the first uses the current protocol (which could be http or https, like wizzwizz4 answered). See this question for more details

flen
  • 1,905
  • 1
  • 21
  • 44