Page 1 of 1

LoadJavaScriptFile from https / running website from http ?

Posted: Sat Oct 15, 2016 12:14 pm
by Sesztak
Dear JS-Support,

We have a practical question:

Background: sometime is practical to load external js resource from 3rd party repository, like:
await CSHTML5.Interop.LoadJavaScriptFile("https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2014-11-29/FileSaver.min.js");

The important part is the https.

If the CSHTML5 site is hosted from http (without 'S' = secure), is it possible to mix https and http ?

e.g. load external js dependencies from https repository (as in our above mentioned example: https://cdnjs ....) and the same time hosting the web site from unsecured http protocol ?

Best Regards,
Péter

Re: LoadJavaScriptFile from https / running website from http ?

Posted: Tue Oct 25, 2016 12:25 am
by JS-Support @Userware
Dear Péter,

The answer is not specific to CSHTML5. It depends on whether in HTML you can do that or not.

It may be worth doing more research on the subject, but I think it is ok to load an "https" script from an "http" page, while the contrary is not possible. As I said though, this is not specific to CSHTML5. CSHTML5 will simply add a standard tag "<script src="https://..." type="text/javascript"/> to the header of the HTML page. If you find more information on the subject, please keep us updated.

Thanks.
Regards,
JS-Support