How to Detect a Click from an Iframe for a Specific Div? Need Help!

16 Replies, 1518 Views

Alex,
I’d recommend checking out [MDN’s guide on postMessage](https://developer.mozilla.org/en-US/docs...ostMessage). It’s super detailed and has examples for exactly what you’re trying to do. Since your iframe is same-domain, you shouldn’t have any issues with permissions or CORS.

Also, make sure you’re using `event.origin` in the parent window to verify the message source. Security first, ya know?

Messages In This Thread



Users browsing this thread: 1 Guest(s)