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

115
Views
Data is not initialized on server but works locally

I have two dynamically created buttons which have click listener. On local web server it works fine, but on a server (AWS EC2 insance) it gives an error:

enter image description here

$('#controlButtonsDiv').append('<button id="reduceButton" value="'+ parseInt(element.quantity) +'" data-article='+element.title+' class="py-2 hover:text-gray-700" onclick="reduce(this)"'> 



        function add(button)
        {
          let prevData = JSON.parse(sessionStorage.getItem(button.dataset.article));
          let quantityChanged = prevData.quantity;
            update({quantity: ++quantityChanged}, button.dataset.article);
            location.reload();
        }
    
        function reduce(button)
        {
          let prevData = JSON.parse(sessionStorage.getItem(button.dataset.article));
          let quantityChanged = prevData.quantity;
            update({quantity: --quantityChanged}, button.dataset.article);
            location.reload();
        }
    

Why is this happening and how could it be fixed?

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!