格納する値の作成(":"で各値を分割)
var tempHash;
tempHash = encodeURIComponent(値1) + ":";
tempHash = tempHash + encodeURIComponent(値2) + ":";
.
.
.
tempHash = encodeURIComponent(値ラスト);
location.hashより取得した値の分割
var locationhash = ブラウザオブジェクトより値を取得;
var hash = locationhash.replace("#","");
var hashArray = decodeURIComponent(hash).split(":");
iframeを使う理由
dom操作によるiframeの動的生成
function appendIframe(){
//動的にiframeを生成。
var ifr = document.createElement('IFRAME');
ifr.style.cssText = "display:none;";
document.body.appendChild(ifr);
}
iframeの取得
function getIframe(){
//iframeを一つしか使っていないことを想定
//iframeのgetElementByIdがIEで上手く行かない?
var iframe = frames[frames.length - 1].document;
return iframe;
}
iframeのlocation.hashの取得
function getIframeLocationHash(){
var iframe = getIframe();
return iframe.location.hash;
}
location.hashの変更
function changeIframeLocationHash(value){
var iframe = getIframe();
iframe.open();
iframe.close();
iframe.location.hash = value;
}
location.hashの変更
location.hash = 変更後の値
比較用の変数lhashAfterを用意して、各処理後にそれにも値を格納するようにする。
※注意※ その場合、"#"も値内に入っている。
チェック時にはまず、