URLの#以降に?が含まれていた場合の挙動
通常、URLの#以降は以下のJSで取得できる。
対象URLが「http://hoge.jp/#fuga.php?id=piyo」の場合
alert( window.location.hash ); alert( window.location.hash.substring(1) );
実行するとそれぞれ
と表示される。
しかしIE6の場合、?以降が取得できない。
解決策
なので?以降を別コードで取得する。
alert( window.location.hash + window.location.search ); alert( window.location.hash.substring(1) + window.location.search );
あとはそれぞれのコードをIE6か否かで分岐して実行すればおk。
IE6未満は知らん。