mardi 5 juillet 2016

laravel google api places autocomplete not working

I have a view in my laravel app

<!DOCTYPE html>
<html lang="en">
<body>
<script type="text/javascript" src="http://ift.tt/13qgtmt"></script>
<script type="text/javascript" src="http://ift.tt/29k3ri1"></script>
<div class="container">
    <div class="col-sm-4">
                        {!! Form::open(array('url' => 'client_home','class'=>"form-horizontal",'files' => true)) !!}

                        <div class="form-group">

                            <label for =''>search</label>
                            <input type="text" id="search">
                        </div>

                        {!! Form::close() !!}
    </div>
</div>


<script>
        alert('here');
        var searchBox = new google.maps.places.SearchBox( document.getElementById('search') );
        alert(searchBox);
        google.maps.event.addListener(searchBox,'places_changed', function() {
            alert('Listener working!');
        });
</script>
</body>
</html>

I'm try to get autocomplete from google. it is working the first and the second alert. but when i start typing in searchbox nothing happens... What I am doing wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire