nute & James Westgate haben Recht, wenn sie auf die spätere Antwort eingehen.
Wenn wir uns die verschiedenen externen Javascript-Includes in Industriequalität ansehen, verwenden die erfolgreichen sowohl das Sniffing von document.location.protocol als auch die Injektion von Skriptelementen, um das richtige Protokoll zu verwenden.
Sie könnten also etwas verwenden wie:
<script type="text/javascript">
var protocol = (
("https:" == document.location.protocol)
? "https"
: "http"
);
document.write(
unescape(
"%3Cscript"
+ " src='"
+ protocol
+ "://"
+ "your.domain.tld"
+ "/your/script.js"
+ "'"
+ " type='text/javascript'
+ "%3E"
+ "%3C/script%3E"
) // this HAS to be escaped, otherwise it would
// close the actual (not injected) <script> element
);
</script>
Gleiches gilt für externe CSS-Includes.
Übrigens: Achten Sie darauf, dass Sie in Ihrem CSS nur den relativen Pfad url () verwenden, falls vorhanden. Andernfalls wird möglicherweise immer noch die Warnung "Mixed Secure and Unsecure" angezeigt.