Right, I attach an event listener for the storage event like this:<div><br></div><div>addHandler(window,"storage",OnStorageHandler);</div><div><br></div><div>where addHandler attaches my OnStorageHandler function to storage event type. Question is now how do I determine which object (localStorage or sessionStorage) has changed from within the OnStorageHandler function. <br>
<br><div class="gmail_quote">On Wed, May 5, 2010 at 6:33 PM, Martin Gainty <span dir="ltr"><<a href="mailto:mgainty@hotmail.com">mgainty@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
you'll need a event listener which is hooked as a callback mechanism to respond to mouse or key events..information on events and how to hook listeners is discussed here<br><a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration-html40" target="_blank">http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration-html40</a><br>
<br>greetings,<br>Martin Gainty <br>______________________________________________ <br>Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité<br><div> <br>Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.<br>
</div><pre>Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.</pre>
<br><br><br><br><br><hr>Date: Wed, 5 May 2010 18:27:49 -0700<div class="im"><br>From: <a href="mailto:jai.ism@gmail.com" target="_blank">jai.ism@gmail.com</a><br></div>To: <a href="mailto:help@whatwg.org" target="_blank">help@whatwg.org</a><br>
Subject: [html5] OnStorage Event<div><div></div><div class="h5"><br><br><div>Hello,</div><div><br></div>I understand that onstorage event will be invoked if setItem, removeItem or clear is invoked on either sessionStorage object or localStorage object. I am curious how can I determine which object has changed from within the onstorage event handler. To be precise, is the function called because localStorage object changed or sessionStorage object changed. storageArea attribute to event object does not help.<br clear="all">
<br>-- <br>Thanks,<br>Jaikishan<br> <br></div></div><div class="hm"><hr>Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2" target="_blank">See how.</a></div>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br>Jaikishan<br>
</div>