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

409
Visualizações
window.addEventListener ('load' function()) not working

I have a page with many articles, now on clicking an article I need to open a new window(compare.html) and show its specifications. I have constructed an array for my html to render and it works fine if its shown in same page but on new window for the html to render I used window.addEventListener("load", function())

Here is the code I used:-

rendered  = compareTpl(articleObj); // this contains the html block,

var w = window.open("compare.html", "compare",
                    "width=960, height=800, scrollbars=yes");

w.addEventListener("load", function()
{
  w.document.getElementById("mdpo").innerHTML = rendered;
 // I am placing my html inside the div(mdpo) content of compare.html page
}); 

It works fine for single article click but on next click the page goes blank.

Please help me with this

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