私は IE10 を使用しており、2 つのタブがあります: - Tab1: index.html - Tab2: update.html
タブ 2 で:
var tel = getURLParameter('TELNR');
if (typeof (Storage) !== "undefined") {
localStorage.setItem("telephone", "" + tel + "");
}
タブ1:
function handleStorage(oEvent) {
var telephone = localStorage.getItem("telephone");
if (telephone != null) {
alert("New call from this phone number:" + telephone);
}
};
$(window).bind('storage', handleStorage);
まず、イベントの発生を待機する tab1 を開きます。次に、特定の電話番号を渡して tab2 を開きます。tab1 のリスナーは正しくトリガーされますが、電話は null です。tab2 を更新すると、今度は handleStorage が正しい番号で呼び出されます。
これは、Chrome と Firefox で完全に機能します。どんな手掛かり?