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

198
Views
El almacenamiento local no se actualiza en mi Chrome cuando se carga JavaScript, a menos que actualice

cuando llamo a la función de devolución de llamada de collectform dentro del oyente formButton, obtengo todo bien, excepto que no veo los datos del objeto en el almacenamiento local de Chrome inmediatamente a menos que actualice el almacenamiento local manualmente.

 function collectFormData(e) { e.preventDefault() let noteTitle = tiTxt.value let noteContent = pTxt.value let date = new Date() const currTime = (date.toLocaleString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true })); let noteObj = { noteTitle, noteContent, loc, currTime } if (!noteTitle && !noteContent === true) { alert('Add note title and content'); } else { allNotes.push(noteObj) wlocalStorage.setItem('noteData', JSON.stringify(allNotes)); (function () { return JSON.parse(localStorage.getItem('noteData')); })() let payload = noteObj; payloadArray.push(payload) // xhr object listen on the server and send data to the server let xhr = new XMLHttpRequest(); xhr.open('POST', '/dash'); xhr.setRequestHeader('content-type', 'application/json;charset=UTF-8'); xhr.send(JSON.stringify(payloadArray)) function showData() { let htmlNote = ` <div class="new-content"> <div class="new_content-child"> <div class="parent_h2-span"> <h2 class="content-h2">${noteTitle}</h2> <span>${currTime}</span> </div> <div class="parent_content-p"> <p class="content-p">${noteContent}</p> </div> <div class="locality-container"> <p class="locality-p">${loc}</p> <span class="edit-con"> <i class="edit-fa fa fa-trash" aria-hidden="false"></i> </span> </div> </div> </div> ` contentContainer[0].insertAdjacentHTML('afterbegin', htmlNote) } showData() tiTxt.value = pTxt.value = ''; } } try { formButton.addEventListener('click', collectFormData) }
about 4 years ago · Santiago Gelvez
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!