Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
Triggering Storage Event Handler After Child Saves LocalStorage Key In Parent

I haven't been able to find a similar post anywhere online. I am having issues triggering a Storage event listener after a child popup window saves to its parent's localStorage. This feels like it should be simple, I'm just not sure if I am on the correct path for accomplishing this.

Environment:

  • Single server, IIS, multiple sites
  • Running PHP 7.4.22 on the server

Usage:

  1. User is filling out a web form
  2. User clicks 'Search' button on the form to import data into form fields
  3. Button loads a popup window of a site stored on the same server, same domain
  4. Item is searched for and selected
  5. Selected item data fields are stored in localstorage of the window.opener element
  6. ISSUE Listener picks up the key being created and is processed by parent

Current Code (Parent):

    window.addEventListener('storage', function(e) {
        alert('Storage change detected.');
        // Do stuff
    });

Desired Result:

  • Selecting an item saves to localStorage and the change is detected by parent - then processed accordingly

Actual Result:

  • Event listener does not trigger when the 'storage' event is triggered by the child. My code will trigger if changes are made IN the parent or in the console, but are not triggered when the localStorage key/value pair is created.
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda