Bug Tracker

Ticket #1412 (closed bug: invalid)

Opened 1 year ago

Last modified 1 year ago

data argument is not passed in, from trigger

Reported by: john Assigned to: brandon
Type: bug Priority: major
Milestone: 1.1.4 Component: event
Version: 1.1.3 Keywords:
Cc: Needs: Patch

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>

Attachments

Change History

Changed 1 year ago by john

Changed 1 year 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"}]);
});
Note: See TracTickets for help on using tickets.