user9958653
user9958653

Reputation:

What's the difference between // and http or https

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>

Upvotes: 0

Views: 1767

Answers (2)

flen
flen

Reputation: 2386

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

Upvotes: 1

wizzwizz4
wizzwizz4

Reputation: 6426

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

Upvotes: 1

Related Questions