I have created an image slider. This slider appears on every page of my website. There's a click event associated with every image in image slider. On clicking any image there are variables which stores data associated with that image(say artist name, etc. and these fields are hidden).
On clicking any image the page is redirected to another page, say artists page. In artists page the stored data are displayed. The image slider is also present in artists page.
Now, the problem is when I come to artists page the variables are not displayed, because the js file in reloaded once again and all data are lost. Javascript file for both the pages are same. Infact, all pages in my website shall use the same js file. But, being in artists page if I click any image then the data are displayed. I want that the data must be retained and displayed even if it gets redirected to artists page.
I have tried ready() event, but no help. How to do it?
P.S. The website is created using Drupal 7