Send data between the main page and a popup.
Introduction
Last updated: 24 Mar 2025
In this example, we open and close a popup using code, and send data between the main page and the popup.
We added the following to our site:
The code in this file enables you to send data to the popup and display data returned by the popup.
In this file, we create an event handler that is triggered when the button to open the popup is triggered. In this event handler, we:
Open the popup and send it the selected greeting and subject. On the same line, we save the popup's response.
Display the popup's response.
The code in this file displays the data sent from the main page to the popup, and enables you to send data back to the main page when closing the popup.
In this file, we:
Join the Wix Studio community on Discord, where experienced developers and fellow creators come together to share tips, troubleshoot issues, and collaborate.
Building a coded solution on your own can be challenging. Let an experienced Wix developer build it for you, so you can keep working on your site or business. Visit the Wix Marketplace to find a trusted developer.