我使用jquery来调用JSON请求,它们是由一堆自动完成字段触发的。我使用了通配符选择器,现在需要找出哪个ac字段触发了事件。
...
$( "[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...感谢您在更明智的解决方案中提供的快速修复或指导。
ATB
//tom joad
发布于 2010-09-27 03:25:52
我相信ui参数下的object是一个elem和origElem,或者类似的名称(可能是target,使用firebug进入内部并深入查看);然后您可以简单地说$(ui.elem).attr('id')。
https://stackoverflow.com/questions/3799351
复制相似问题