wix-storage – How to retrieve data from another page

Dear All,

There is something I do not understand with the code syntax regarding wix-storage.

I have:
Page1

  • Input field $w("#InputItemID ")
  • Button to open Page2 $w(“#Button1”)

Page2

  • Input field $w("#InputItemID ")

I’ve tried so many combinations with no success that now I’m asking for your help.

Page 1 Code
import {local} from ‘wix-storage’;
export function Button1_click(event) {
local.setItem(“key”, “value”);
}

Page 2 Code
import {local} from ‘wix-storage’;
$w.onReady( function () {
let value = local.getItem(“key”); // “value”
}

My problem is that I do not know how to define “key” and “value”

Thank you for your help
Best regards,
Domivax

HI @domivax , hi @deleteduser

I have a similar request, but the link is not available anymore.
Could you tell me how do you solved this topic, please?

Best Regards

Orhan