Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7503433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:13:14+00:00 2026-05-29T21:13:14+00:00

Hi all please let me know the meaning of following statement addEvent(window, ‘storage’, function

  • 0

Hi all please let me know the meaning of following statement

addEvent(window, 'storage', function (event){
    if (event.key == 'storage-event-test'){
        output.innerHTML = event.newValue;
    }
});

addEvent(dataInput, 'keyup', function (){
    localStorage.setItem('storage-event-test', this.value);
});

Please explain me what is addEvent() method and what does above code does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:13:15+00:00Added an answer on May 29, 2026 at 9:13 pm

    There is no addEvent method as part of javascript, could be an externally written function. There is element.addEventListener

    From your code the addEvent expects this signature:

    addEvent(obj, an_event_string, callback_fn);
    

    The first parameter I’m not sure about, just takes an object. The second is a string representing (I’m guessing) the event and the third is a function that is called when the event happens.

    addEvent(window, 'storage', function (event){
        //for the "storage" event this function is called
       // and some info is passed in the event argument
        if (event.key == 'storage-event-test'){ //if the key is..
            output.innerHTML = event.newValue;
        }//then set the innerHtml to a value from the event
    });
    
    addEvent(dataInput, 'keyup', function (){
        //for the "keyup" event
        //save an item into local storage
        localStorage.setItem('storage-event-test', this.value);
    });
    

    See here for more about local storage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you know of a comprehensive list of all possible NSNotifications? Please let me
Please let me know which of the following is a good programming practise: 1.
All, Can anyone please let me know exactly what are the performance issues between
Hopefully I can explain this well enough, but please let me know if more
I've spent a lot of time searching for this, please let me know if
Please let me know if this is bad practice or in someway a bad
Hi any one let me know How to make class not derivable at all.
Newbie to StackOverflow as a poster, so please let me know if I violate
I am not sure if this is possible, so please let me know. I
I'm thinking of an approach something like this. Please let me know if this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.