I am attempting to access data from another page using session storage.
On my initial page, named 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>
On the second page FAQ.html
var qpara2 = sessionStorage.getItem('key2');
alert(qpara2);
First concern:
When I click the first link (Open First Question), it returns null on the initial click. The correct value (1) appears on the second click.
If I click the second link (Open Last Question), it displays the previous value (1) initially. Only after clicking again does it update to the correct value (2). It seems to have issues functioning correctly from the first click.
Second concern:
This functionality doesn't seem to work properly in Internet Explorer.