html5 session storage
I have 2 pages, 1st contains a div and 2nd page contains some image.I have a functionality that if user clicks on any image in 2nd page, the page redirects to 1st page and the selected image should come in the div on the 1st page.
How can this be achieved via HTML5 Session Storage??
Before taking the user to the first page, set sessionStorage.imageclicked = [whatever image was clicked here]. Then, get that value and use it to show the image.
May I ask, though, why don't you just use a normal link?
http://example.com/firstpage.ext?image=[whatever image was clicked]
This is supported in even the oldest of browsers.