Web Technologies - HTML5

Back to Course

Lesson Description

Lession - #591 HTML5 WebMessaging

Web messaging is the ability to send realtime messages from the server to the shopper browser. It overrides the cross domain communication problem in different domains, protocols or ports

For example, you want to send the data from your page to ad container that is placed at iframe or voice-versa, in this scenario, Browser throws a security exception. With web messaging we will pass the data across as a message event.

Message Event
Message events fires Cross-document messaging, channel messaging, server-sent events and web sockets.it has described by Message Event interface.

1 data
Contains string data

2 origin
Contains name and port

3 lastEventId
Contains unique identifier for the current message event.

4 source
Contains to A reference to the originating document’s window

5 ports
Contains the data that is sent by any message port