Skip to main content

Bug Tracker

Side navigation

#13006 closed bug (notabug)

Opened December 05, 2012 10:08PM UTC

Closed December 06, 2012 02:05AM UTC

postMessage events lack data

Reported by: james@zendesk.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:
Description

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/

Attachments (0)
Change History (1)

Changed December 06, 2012 02:05AM UTC by dmethvin comment:1

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).