在动态生成的元素上启动地理填充

时间:2015-02-20 22:29:14

标签: jquery geocomplete

我想在我的表单中完成地理填充工作。问题是假设注册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"
        });

    }
})
}

0 个答案:

没有答案