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

152
Views
localstorage getitem is not working on Firefox (version99.0.1), it return null

Local storage getitem() is not working while local storage setitem() is working and it only happens with Firefox. My assignment will be tested on firefox and required for localstorage.

js code for 1st HTML page

function studentinfo(firstname,lastname,studentid,checked){
    
    localStorage.setItem("Firstname",firstname);
    localStorage.setItem("Lastname",lastname);
    localStorage.setItem("Studentid",studentid);
    localStorage.setItem("Score",checked);
    localStorage.setItem("test","testlocalstorage");
    sessionStorage.setItem("session","testsession");
    console.log("test")
}

js code on 2nd HTML page

function getStudentinfo(){
    if(localStorage.Firstname !== undefined){
        document.getElementById("submitfirstname").textContent = localStorage.getItem("Firstname");
    }
    
}

function init(){
    
    // var result = document.getElementById("submittest"); 
    // result.onsubmit = validate;        
    console.log(localStorage.getItem("Firstname"))
    console.log(localStorage.getItem("test"))
    console.log(sessionStorage.getItem("session"))
    getStudentinfo();
}
 
window.onload = init;

the console.log for localstorage return null for both of them sessionstorage is fine.

happy to share the full code if needed.

Thanks

about 4 years ago · Santiago Trujillo
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!