Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

408
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!