我在地址中使用了Google geocomplete函数,但是当我尝试将adrress存储在数据库中时,它显示为“ NULL”(无数据)。
$(document).ready(function() {
$("#input_location").keyup(function() {
$("#input_location").geocomplete();
$.fn.geocomplete("#input_location");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/geocomplete/1.7.0/jquery.geocomplete.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&components=country:in&key=AIzaSyBu3Gmie5smTxXvKmyfdeNcja0n574RXAE" type="text/javascript"></script>
<div class="form-group">
<label class="control-label">Property Location</label>
<input name="property_location" id="input_location" type="text" required="required" class="form-control" placeholder="Your Property Location" />
</div>