- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML5 / JS storage event handler
Storage event handlers only fire if the storage event triggered by another window. You can try to run the following code:
// event handler window.addEventListener('storage', storageEventHandlerFunc, false); function storageEventHandlerFunc(evt) { alert("Storage event called key: " + event.key ); switch(event.key){ case 'one': case 'two': batteryDCMeter(); break; case 'extPowerOn': rechargeBattery(); break; } } sessionStorage.setItem("someKey", "someValue");
Advertisements