3

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

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Manish Jakhmola
  • 197
  • 1
  • 3
  • 12

1 Answers1

3

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>
monteirobrena
  • 2,562
  • 1
  • 33
  • 45