开发者

jquery: howto return caller-id when using wildcard selectors

开发者 https://www.devze.com 2023-01-18 03:47 出处:网络
i\'m using jquery to invoke JSON-requests and they\'re triggered form a bunch of autocomplete-fields. I use wildcard-selector and now need to find out which ac-field that fired the event.

i'm using jquery to invoke JSON-requests and they're triggered form a bunch of autocomplete-fields. I use wildcard-selector and now need to find out which ac-field that fired the event.

...
$( "[id*='_lookupCmb']" ).autocomplete({
  source: function( request, response ) {
    $.ajax({
      ...
      ...
      select: function( event, ui ) {
        //here I want to get the name of the id calling the request...

Thankful for any q开发者_如何学Gouickfix or guidance in wiser solution.

ATB

//tom joad


I believe under the ui argument object is an elem, and origElem, or something of a similar name (might be target, break inside using firebug and drill into it to find out for sure); then you can simply say $(ui.elem).attr('id').

0

精彩评论

暂无评论...
验证码 换一张
取 消