If you look at the examples in the "bind" documentation (
http://docs.jquery.com/Events/bind ) there's this sample:

function handler(event) {
  alert(event.data.foo);
}
$("p").bind("click", {foo: "bar"}, handler)

So for your example that could be:

var someVar = {
   init : function () {
       $('#someID').bind("click", {'args': ['arg1', 'arg2']}, this.add);
   },
   add : function(event) {
       alert(event.data.args[0] + ' : ' + event.data.args[1]);
   }
};

Karl Rudd

On Wed, Jan 28, 2009 at 5:12 PM, Anjanesh <anjanesh.for...@gmail.com> wrote:
>
> I understand jQuery has parameters stored in event.data.*
> But Is there a way to achieve this using jQuery ?
>
> var someVar = {
>    init : function () {
>        $('#someID').bind("click", ['arg1', 'arg2'],
> this.add);
>    },
>    add : function(p1, p2) {
>        alert(p1 + ' : ' + p2); // Doesnt show arg1 : arg2
>    }
> };
>
> Thanks

Reply via email to