> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: siteWindow.close(data: object) # Method Link: https://dev.wix.com/docs/sdk/frontend-modules/window/lightbox/close.md # Method Description: Closes a popup. > **Note:** The terms popup and lightbox refer to the same element. While the editor and dashboard now refer to it as a [popup](https://support.wix.com/en/article/studio-editor-using-popups), the API methods continue to use the term lightbox for backward compatibility. The documentation uses both terms accordingly. The `close()` method closes a popup and allows you to pass data from the popup to the page that opened the popup. If a popup is closed through the 'X' icon, close button, or popup overlay, data will not be returned to the original page. To ensure data can be passed: 1. Call this method to close a popup programmatically. For example, add a button with an `onClick` event that calls `close()`. 2. Disable these closing options in the popup's settings under [**Set Triggers**](https://support.wix.com/en/article/studio-editor-using-lightboxes#setting-triggers-for-a-lightbox). # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## Close a lightbox ```javascript import { lightbox } from '@wix/site-window'; // ... await lightbox.close(); ``` ## Close a lightbox and pass back the data ```javascript import { lightbox } from '@wix/site-window'; // ... await lightbox.close(dataObj); ``` ## A scenario where information is passed between a page and a lightbox ```javascript /************* * Page Code * *************/ import { lightbox } from '@wix/site-window'; $w('#myOpenButton').onClick(async (event) => { await lightbox.openLightbox("MyLightBox", { "pageSend1": $w('#pageSend1').value, "pageSend2": $w('#pageSend2').value }) .then( (data) => { $w('#pageReceive1').text = data.lightBoxSend1; $w('#pageReceive2').text = data.lightBoxSend2; } ); }) /***************** * Lightbox Code * *****************/ import { lightbox } from '@wix/site-window'; $w.onReady(async function () { let received = await lightbox.getContext(); $w('#lightBoxReceive1').text = received.pageSend1; $w('#lightBoxReceive2').text = received.pageSend2; } ); $w('#myCloseButton').onClick(async (event) => { await lightbox.close( { "lightBoxSend1": $w('#lightBoxSend1').value, "lightBoxSend2": $w('#lightBoxSend2').value } ); } ); ```