我想在我的表单中完成地理填充工作。问题是假设注册goecomplete的元素是动态插入的html:
function fetch_company_info (id) {
id = typeof id !== 'undefined' ? id : 0;
$.ajax({
type: "POST",
url: "fetch_company_info.php",
data: { id : id },
success: function(msg) {
$('#company_info_container').html(msg); //html of .geocomplete element is generate here
$(".geocomplete").geocomplete({ //this does not work
country: "CA"
});
}
})
}