A
A
Alexey Vinogradov2017-06-01 21:47:47
css
Alexey Vinogradov, 2017-06-01 21:47:47

When changing the protocol to https, CSS and JS fell off?

I am working on the site www.rotaract.ru when switching to the secure protocol https://www.rotaract.ru/ , the connected CSS and JS fall off.
On the Internet I found the opportunity to connect them via JS, but this code only works for one file, it didn’t work to connect folders, so that everything works for me, I need to copy this code by changing the path to the file with which the problem ... I don’t really like this option. There are a lot of problematic files. If anyone knows a short way to solve the problem, I will be glad to help. Not strong in JS.
This is the code I found on the internet.
var$=document; // shortcut
var cssId = 'myCss'; // you could encode the css path itself to generate id..
var head = $.getElementsByTagName('head')[0];
var link = $.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = ' https://rotaract.ru/style/0010-main.css ';
head.appendChild(link);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bogachev, 2017-06-01
@panama_v

Either I didn’t quite understand the question, or you don’t have problems with https or JS, but with the fact that you moved something somewhere, but didn’t correct the links. You can go through the files following a logical chain.
Only one falls off:
Там стилей и правда нет. Вообще. Файла такого нет.
А вот другой файл, который вы отметили в вопросе, - есть. Подключаем - все уже лучше:
Теперь, когда стили на месте, посыпались картинки:
Очевидно из-за того, что в файле со стилем пути к картинкам не те - они лежат на одну директорию выше, добавьте ко всем путям "../" и они загрузятся. Ни или (альтернативно) - верните стили туда, где они были изначально.
I think it's worth starting with this. And scripts and so it seems are loaded normally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question