About window.postMessage()
window.postMessage()method safely enables cross-origin communication. Normally, scripts on different pages are allowed to access each other if and only if the pages that executed them are at locations with the same protocol(https).
window.postMessage()provides a controlled mechanism to circumvent this restriction in a way which is secure when properly used.
Demo
Messaging with Visualforce Page
References
- MDN
- Cross-Domain Messaging With postMessage
- Communicating between Lightning Components and Visualforce Pages
Account ID | Account name |
---|---|
123 | Account 1 |
456 | Account 2 |
Accounts