geocomplete is not a function using autocomplete

时光怂恿深爱的人放手 提交于 2019-12-11 10:26:52

问题


Hi i am using autopopulated code getting the error geocomplete is not a function if is used it in locally (seperated file) it works for me what can be the error

$(function () { 
    $("#location").geocomplete({
        //alert("gine");
      details: ".geo-details",
      detailsAttribute: "data-geo"
    });

});

Pls suggust


回答1:


You must to add the jquery.min.js and jquery.geocomplete.min.js before call the geocomplete() method:

<script src="/javascripts/jquery.min.js" type="text/javascript"></script>
<script src="/javascripts/jquery.geocomplete.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $("#location").geocomplete({
    details: ".geo-details",
    detailsAttribute: "data-geo"
  });
</script>


来源:https://stackoverflow.com/questions/33514921/geocomplete-is-not-a-function-using-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!