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

143
Views
Cómo leer el JSON de almacenamiento local en el archivo angular index.html y mostrarlo en la fuente de la página Ver como un script

Tengo JSON en mi localStorage que quiero leer en mi archivo angular index.html y también quiero mostrar este JSON cuando veo la fuente de la página Ver. Debajo del código, lo he intentado. Nota: Cuando veo el origen de la página de visualización, solo HTML simple muestra la dinámica de almacenamiento local.

 <html> <body> <script type="text/javascript"> window.onload = function() { alert(JSON.stringify(JSON.parse(localStorage.getItem('profileJson')))); var data = JSON.stringify(JSON.parse(localStorage.getItem('profileJson'))) var nameFromJson = data.default.provider.name document.getElementById("demo").innerHTML = nameFromJson; } </script> <p id="demo"></p> <app-root></app-root> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ver código fuente de la página solo obtiene el código HTML sin procesar y luego lo muestra. Por lo tanto, no podría acceder al almacenamiento local cuando obtenga ese texto porque requeriría que se ejecute JavaScript.

about 4 years ago · Juan Pablo Isaza Report
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!