Results 1 to 7 of 7

Thread: [RESOLVED] Trying to retrieve a session variable in Javascript?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Resolved [RESOLVED] Trying to retrieve a session variable in Javascript?

    I have two html pages, NO ASPX. I use javascript like this:
    Code:
    sessionStorage.setItem("locale", "photos/BOP")
    To capture the value of "photos/BOP" and that works fine. I want to retrieve this value in the 2nd html page using javascript. I have my body tag set up like this:
    HTML Code:
    <body onload="getImages()">
    Here is the getImages function in the 2nd html page:
    Code:
    function getImages() {
        var fileextension = "jpg";
        var dir = sessionStorage.getItem("locale");
    
        alert(dir);
    }
    When the value is shown in the alert statement, it's NULL. What am I doing wrong
    Last edited by dday9; Jul 2nd, 2021 at 11:58 AM.
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width