S
S
sorry_i_noob2019-09-23 20:00:31
css
sorry_i_noob, 2019-09-23 20:00:31

If I take a remote resource (.js, .css, .jpg...) via https, and the site with the resource is available via http. Or vice versa. Is it always possible to take?

I want to use protocol-relative links everywhere on my site:

<script src="//example.com/script.js" type="text/javascript"></script>

Since there is ssl on the prod, but it is not on the local server.
I have a question. If I take js, css, jpg... and other files from other sites in this way. Will this always work?
The protocol-relative link substitutes the protocol that is currently used on my site. For example, if I have http on my site, then http will be substituted.
And if I want to get a resource from another site. And the other site works on https. Will I succeed?
And vice versa - if my site is on https and the other is on http.
Will it always work or does it depend on the developer of the other site - did he redirect to .htaccess or not? Or from something else?
I can test it myself, but I don't know all the settings of different servers (apache, nginx...). Maybe it will work for me. But then somewhere - no. Because of what there will be a bug that I or another developer will look for a long time.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rusglov, 2018-05-13
@rusglov

Normal div slider, arrows - switches, day - slide.

D
DevMan, 2019-09-23
@sorry_i_noob

depends on how the remote site handles requests.

S
skrimafonolog, 2019-09-23
@skrimafonolog

The browser will swear (in the address bar it will show redness, saying that there is no trust in the site), but it will do so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question