JavaScript function pass-through?

Posted by Lance May on Stack Overflow See other posts from Stack Overflow or by Lance May
Published on 2010-05-24T20:17:55Z Indexed on 2010/05/24 20:21 UTC
Read the original article Hit count: 283

I'm not sure if this is doable, but I would like to be able to set a jQuery UI event as a function (directly), as opposed to continuing to wrap in additional function(event, ui) { ... } wrappers.

Hopefully you can see what I'm going for from the example below.

Here is what I would like:

$("#auto").autocomplete({
    source: "somepage.php",
    select: dropdownSelect,
    minLength: 0
});

Now I would think that the above would work, since I'm simply trying to say "continue firing this event, just over to that function". Unfortunately, that will not work, and I'm ending up with this: (and for some reason, a disconnect from all data)

$("#auto").autocomplete({
    source: "somepage.php",
    select: function(event, ui) { dropdownSelect(event, ui) },
    minLength: 0
});

Thanks much in advance.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery