#9571 closed bug (worksforme)
Pass 'empty string' as arbitrary data with , trigger()
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Sending data with trigger differs between version 1.5 and 1.6.1. I can't figure out what causes this behaviour from reading the official change log.
With 1.6.1 => undefined, undefined
With 1.5.0 => (an empty string), undefined
$(document).ready(function() { $("p").click( function (event, a, b) { console.log(a); console.log(b); } ).trigger("click", ''); });
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → event |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
This works for me: http://jsfiddle.net/NE8ma/1/
comment:3 Changed 12 years ago by
This was a bug I introduced in 1.6 and rwaldron fixed, should be in 1.6.2 when that is released. As a workaround, specify an Array with your string, like .trigger("click", [''])
(the code converts it internally to an array if you don't supply one).
Note: See
TracTickets for help on using
tickets.
sorry, it's my first report, jsfiddle below:
http://jsfiddle.net/HPvfg/
http://jsfiddle.net/HPvfg/1/