0

I need to know what iframe sent message to the parent window, as I'll have multiple iframes on one iframe hosting page.

How can I check which of the frames sent the message?

putvande
  • 15,068
  • 3
  • 34
  • 50
Artek Wisniewski
  • 797
  • 5
  • 13

1 Answers1

1

You can only check which domain sent the message. If you need more identification you can always layer it into your messaging system.

Send messages like:

message = {
    "source": "menu",
    "message": "click on entry"
};

Each frame then has their own source. You will need to serialize the message, JSON works nicely.

Halcyon
  • 57,230
  • 10
  • 89
  • 128