Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
LocalStorage does not work on mobile?

I'm using localStorage to back up form data on a long form. So if a user refreshes they will not lose everything. This is working perfectly on Chrome & Firebox on the computer.

However on mobile (iOS at least) It's not working at all. Any advice?

Here is a small part of my code as an example:

Storing Data:

 window.onbeforeunload = function() {
       window.localStorage.setItem("Job1", $("#topScore1B").text());
    }

Retrieving Data:

window.onload = function() {
    //   If values are not blank, restore them to the fields
        var name = window.localStorage.getItem('Job1');
        if (name !== null) $('#job1').text(name);


}
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The beforeunload event does not fire on iOS.

It looks like unload does fire, so try storing your data into local storage there instead.

Alternatively, you could store data into local storage as the user edits the form (ie when each input fires change), which comes with the added bonus of storing the entered data even if the browser crashes before the user finishes.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda