0

This script fetches an address when the user inputs a house number and postcode. It works fine in chrome and firefox but doesn't work in IE.

I have already added:

but still no luck. Any ideas?

<script type="text/javascript">
        $('#submit').click(function() {
          //Get Postcode
          var number = $('#number').val();
          var postcode = $('#postcode').val().toUpperCase();;

          //Get latitude & longitude
          $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=' + number + " " + postcode + '&sensor=false',
            function(data) {
              //Insert
              $('#text').text(number + ', ' + data.results[0].formatted_address );
            });
        });
    </script>

0 Answers0