Copy link to clipboard
Copied
I'm building my first mobile app using the Jquery sample page that has all of the app/site pages in a single file. Everything is working fine except that I need to execute a javascript when an internal page loads. I'm setting a sessionStorage variable when the internal link is clicked and need to use that variable to update an image when the requested page loads.
Here's the link on my page:
<a href="javascript:displayNewImage(8)">Image 8</a>
and my function:
function displayNewImage(imageNum) {
alert('Image #' + imageNum + ' selected');
sessionStorage.imageNum = imageNum;
location.hash = "#images";
}
The last line in the function loads the internal page successfully but I need to change the image that is already on that page based on the sessionStorage.imageNum variable but can't figure how to anything but load the page with whatever was on it originally. The image is in a div on the page like so:
<div id="dispalyImage"><img src="image1.png"></div>
Thanks in advance for any input.
Michael
Copy link to clipboard
Copied
Might need to clarify that the link that navigates to the page where I need to change the image is on a separate page (internal div with data-role="page") -- so I'm clicking a link on page one - setting a sessionStorage variable - and then navigating to page to where I need to update the image.
Thanks.
M
Find more inspiration, events, and resources on the new Adobe Community
Explore Now