Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

98
Visualizações
issue with session storage

I am trying to retrieve data from another page by using sessionstorage.

My first page home.html

function go_to_faq(qnum){

window.open('FAQ.html', '_blank');

sessionStorage.setItem('key2', qnum);

}
<a style="cursor: pointer;" onclick="go_to_faq('1')" target="_blank"> Open First Question </a>
<a style="cursor: pointer;" onclick="go_to_faq('2')" target="_blank"> Open Last Question</a>

Second page FAQ.html

var qpara2 = sessionStorage.getItem('key2');

alert(qpara2);

First issue:

At first click on (Open First Question), it give me null. Second click gives me the right value(1).

If I click the second link (Open Last Question), it gives me the last old value (1). When I click it again it will update it and give me (2). So it does not work properly from the first click.

Second issue:

It does not work in IE.

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

first issue is fixed .. I have just to open the page after store the value

function go_to_faq(qnum){

sessionStorage.setItem('key2', qnum);

window.open('FAQ.html', '_blank');



}

about 4 years ago · Juan Pablo Isaza Relatório

0

If it doesn't work in IE which I am assuming refers to the Internet Explorer then you can try using some other browser like Firefox, Google Chrome, Microsoft Edge. Also, I would recommend using Firefox.

about 4 years ago · Juan Pablo Isaza Relatório

0

you need to open the page (window.open) and then apply your changes on there !

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda