Is it possible to automatically detect whether or not the page is accessed via http or https and then include a or ?
Is javascript included via https any different? I'm talking about cache age and so on?
Thanks, Wesley
Is it possible to automatically detect whether or not the page is accessed via http or https and then include a https://url.js or http://url.js ?
Is javascript included via https any different? I'm talking about cache age and so on?
Thanks, Wesley
Share Improve this question asked Nov 5, 2011 at 20:16 user429620user4296201 Answer
Reset to default 11Use a protocol-relative link, starting with //
instead of http or https
:
<script type='text/javascript' src="//path/to/file.js"></script>