R
R
retyui2017-12-21 15:57:10
Browsers
retyui, 2017-12-21 15:57:10

What is the best way to specify the request protocol //url or specifically https://url?

What is the advantage of the first method or what is the support of the browsers? or specifically
<img src="//domain.com"/>

<img src="https://domain.com"/>
<img src="http://domain.com"/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Syomov, 2017-12-21
@kotomyava

It is better to specify the
Domain in general and the protocol will be set automatically ...
Browsers support all the options you specified in the same way.
In the first one, the protocol of the page that caused the request will be automatically substituted.
In the third, there will be mixed content if such a link is on the page opened via https, which, of course, is not correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question