It seems that in IE8, if the page using https protocol needs to import a .js file, the .js file also needs to use the https protocol.
<script type='text/javascript' src='http://xxx/yourjs.js'></script>
works in all browsers except IE8
<script type='text/javascript' src='https://xxx/yourjs.js'></script>
works in all browsers
I am using a usercontrol which imports several .js files. This means that if one page uses https protocol, then I have to alter the usercontrol so that all imported .js files are using https protocol.
How do you resolve this issue?
How do you comment on this IE8 behavior?
Using this on HTTPS
should throw up a warning to the user in all browsers – I’d expect IE8 to do the same but maybe it’s a new ‘feature’ to silently ignore it.
You should use the same protocol that the request is on, or failing that always HTTPS (though this will be slower for the user and put more load on your server).
You could specify the URL without the scheme – that should use the current one (http or https):
Edit: Found the reference saying this is valid: RFC 2396