私はcookieを設定します。したがって、オプトインは(ユーザーがCookieを持っているか期限切れになっている限り)保持されます。私はあなたが新しいブラウザに更新する要求であなたのユーザーを傷つけたくないと確信しています。 :)
から:http://techpatterns.com/downloads/javascript_cookies.php
ie.html
function SetCookie(name, value, expires, path, domain, secure)
{
// set time, it's in milliseconds
var today = new Date();
today.setTime(today.getTime());
/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if (expires)
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date(today.getTime() + (expires));
document.cookie = name + "=" +escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}
document.cookie = SetCookie('allowolderie','true','365','/','.example.com');
次に、あなたのIE conditional内で、リダイレクトする前にクッキーが真実でないことを確認します
index.htmlを
<!--[if lte IE 8]>
<script type="text/javascript">
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
if (readCookie('allowoldie') != 'true') {
window.location = 'ie.html';
}
</script>
<![endif]-->
この方法では、GET文字列に入れてユーザーのために保守する必要はありませんが、バックアップとして行うことができます。
あなたはIE8をサポートしていませんか?おめでとう、あなた、あなたは私の一日のヒーローです。 –