Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13006 closed bug (notabug)

postMessage events lack data

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:


The postMessage API takes two arguments: a message and a targetOrigin. When using the native window.addEventListener, the listener gets an event with the message in the "data" field. When using $(window).on('message'), the data field is blank.

See http://jsfiddle.net/S8k6C/1/

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

jQuery's Event object only normalizes a small set of properties, as documented. If you want raw unprocessed properties, use event.originalEvent.data for example. In particular, the .data property in event.data would correspond to any data parameter passed in .on(event, data, fn).

Note: See TracTickets for help on using tickets.