Bug Tracker

Modify

Ticket #1412 (closed bug: invalid)

Opened 6 years ago

Last modified 6 years ago

data argument is not passed in, from trigger

Reported by: john Owned by: brandon
Priority: major Milestone: 1.1.4
Component: event Version: 1.1.3
Keywords: Cc:
Blocking: Blocked by:

Description

Here's the sample code (happened in FF 2.0.0.5 on OSX):

<script src="dist/jquery.js"></script>
<script>
$(document).ready(function(){
        $("#test").bind("test",function(e){
                alert(e.data);
        });
        $("#test").trigger("test",{foo:"bar"});
});
</script>
<style>
#test { width: 100px; height: 100px; background: red; }
</style>
<div id="test"></div>

Change History

comment:1 Changed 6 years ago by john

comment:2 Changed 6 years ago by brandon

  • Status changed from new to closed
  • Resolution set to invalid

trigger takes an array that translates into arguments for the handler.

$(document).ready(function(){
        $("#test").bind("test",function(e, data){
                alert(data.foo);
        });
        $("#test").trigger("test",[{foo:"bar"}]);
});

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.