ユーザーが HTTP ではなく HTTPS を使用するように強制する単純なリダイレクトを行っています。newUrl 変数を短縮する方法はたくさんあることは知っていますが、これは IE8 では継続的にループしますが、FF では機能します。ページの残りの部分は読み込まれません....しかし、私が望んでいる目的のURLを取得します.... IE8でwindow.locationが異なる理由を知っている人はいますか??
<script language="JavaScript">
if (location.protocol = "http:") {
var newUrl = "https://";
newUrl += location.hostname;
newUrl += ":64040";
newUrl += location.pathname;
newUrl += location.search;
// redirect
window.top.location = newUrl;
}
</script>