I want the value that is kept in a variable to be available at any other page. Is there anyway to do this?
You can simply use Wix Storage API.
https://www.wix.com/corvid/reference/wix-storage.html
How do I pass data between pages in my site?
Use the wix-storage API. Use the setItem() function to place data in storage on the originating page. Then use the getItem() function to retrieve the data on the target page.
Or, if it is already saved in a dataset, then you can simply call it from the dataset on whatever page you are wanting.
I tried with memory.setitem in page1 and memory.getitem in page2, but getting null value in page2.
@theastylesie
Then perhaps you did something wrong. Where is your code?
And you should always, better open an own new thread, with your own issue-topic, instead of bumping up old ones.
Thanks for replying.
I have this code in page 1
import {local} from ‘wix-storage’ ;
export function box8_click(event,$w) { local.setItem( “jsundertf” , “Jeans” ); }
and this code in page 2
import {local} from ‘wix-storage’ ;
export function button1_click(event,$w) { let x= local.getItem( “jsundertf” ); console.log(x); }
Page 2 returns NULL.
I have tried with memory and session but the result remains same.