> 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.postMessage(message: object, target: string) # Method Link: https://dev.wix.com/docs/sdk/frontend-modules/window/post-message.md # Method Description: Sends a message to a page's parent. If a page is embedded within another site, using an [HtmlComponent](https://dev.wix.com/docs/velo/api-reference/$w/html-component/introduction.md) on a Wix site or an [iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) on a non-Wix site, call this method to send a message from the inner site to the outer site. When the parent site is a Wix site, call [`onMessage()`](https://dev.wix.com/docs/velo/api-reference/$w/html-component/on-message.md) to receive the message on the parent page. When the parent site is a non-Wix site, use the page's `window.onMessage` event to read the `data` property of the received `MessageEvent` to receive the message on the parent page. # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## Send a message to a Wix parent site ```javascript /* * * * * * * * * * * * * * * * * * * * * * * * Code for the inner site to post a message * * * * * * * * * * * * * * * * * * * * * * * */ import { window } from '@wix/site-window'; // ... await window.postMessage(dataObj); /* * * * * * * * * * * * * * * * * * * * * * * * * * Code for the outer site to receive a message * * * * * * * * * * * * * * * * * * * * * * * * * * * * $w("#myHtmlComponent").onMessage( (event, $x) => { * let message = event.data; * } ); */ ``` ## Send a message to a non-Wix parent site ```javascript /* * * * * * * * * * * * * * * * * * * * * * * * Code for the inner site to post a message * * * * * * * * * * * * * * * * * * * * * * * */ import { window } from '@wix/site-window'; // ... await window.postMessage(dataObj); /* * * * * * * * * * * * * * * * * * * * * * * * * * Code for the outer site to receive a message * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ```