从 jQuery .get() 调用返回时,我遇到了 cfinput 标记的问题。如果我像这样将标签放在主页上:
<cfform>
<cfinput type="text" name="txtinputfilter" autosuggest="cfc:#Application.cfcDir#autoSuggest.lookupTailNumber({cfautosuggestvalue})" >
标签正确加载,自动建议按预期工作。但是,如果我将完全相同的标签(仅此而已)放在名为 common/includes/FilterData.cfm 的单独模板中,并从主页中调用它,如下所示:
<div id="txt_input_container"></div>
$(document).ready(function(){
//the following get call is normally called on another select input's onchange
$.get('common/includes/FilterData.cfm',
//note that the following parameters are not being used in this example
{column: selectedValue,
filterValue: filterValue,
filterID: filterID,
configFile: 'Tracking/config/GeneralMaint.xml'},
function(response){
$('#txt_input_container').empty().append(response);
}
);
});
标签加载,但自动建议不起作用。控制台显示我得到了另外八个电话:
http://localhost/CORE/common/includes/FilterData.cfm?column=SERIAL_NUMBER&filterValue=&filterID=fi_1&configFile=Tracking%2Fconfig%2FGeneralMaint.xml
http://localhost/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js?_=1318592952367
http://localhost/CFIDE/scripts/ajax/yui/animation/animation-min.js?_=1318592952634
http://localhost/CFIDE/scripts/ajax/yui/autocomplete/autocomplete-min.js?_=1318592952706
http://localhost/CFIDE/scripts/ajax/messages/cfmessage.js?_=1318592952745
http://localhost/CFIDE/scripts/ajax/package/cfajax.js?_=1318592952782
http://localhost/CFIDE/scripts/ajax/package/cfautosuggest.js?_=1318592952821
http://localhost/CFIDE/scripts/cfform.js?_=1318592952859
http://localhost/CFIDE/scripts/masks.js?_=1318592952907
后跟此错误消息:
_cf_resetLoadingIcon_1318592952305 is not defined
[Break On This Error] /* ]]> */</script>