Hi all,
I'm using safari webkit's engine together with HTML5 and JS to create an offline application now I'm using the sessionStorage array to store status of my application(simulation).
the storage data works fine with the inspector the functions work fine it's the event handler that isn't responding
the test preformd by Anurag
at http://jsfiddle.net/pvRgH/ also doesn't work here
window.addEventListener('storage', storageEventHandler, false);
function storageEventHandler(evt){
alert("storage event called key: " + evt.key );
switch(evt.key){
case 'bat1':
case 'bat2': batteryDCMeter(); break;
case 'extPowerOn': rechargeBattery(); break;
}
}
function load()
{
dashcode.setupParts();
//set HTML 5 key/value's
sessionStorage.setItem('bat1', 'OFF');
sessionStorage.setItem('bat2', 'OFF');
sessionStorage.setItem('bat1DC', '26.2');
sessionStorage.setItem('bat2DC', '26.2');
}
function bat1OnOff(event)
{
if(sessionStorage['bat1'] == 'OFF'){
sessionStorage['bat1'] = 'ON';
}else{
sessionStorage['bat1'] = "OFF";
}
}
function bat2OnOff(event)
{
if(sessionStorage['bat2'] == 'OFF'){
sessionStorage['bat2'] = 'ON';
}else{
sessionStorage['bat2'] = "OFF";
}
}