Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用谷歌api在chrome和firefox中搜索地址,但不使用IE_Javascript_Html_Json - Fatal编程技术网

Javascript 使用谷歌api在chrome和firefox中搜索地址,但不使用IE

Javascript 使用谷歌api在chrome和firefox中搜索地址,但不使用IE,javascript,html,json,Javascript,Html,Json,此脚本在用户输入门牌号和邮政编码时获取地址。它在chrome和firefox中运行良好,但在IE中不起作用 我已经补充说: 但还是没有运气。有什么想法吗 <script type="text/javascript"> $('#submit').click(function() { //Get Postcode var number = $('#number').val(); var postcode = $

此脚本在用户输入门牌号和邮政编码时获取地址。它在chrome和firefox中运行良好,但在IE中不起作用

我已经补充说:

但还是没有运气。有什么想法吗

<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>

$(“#提交”)。单击(函数(){
//获取邮政编码
var number=$('#number').val();
var postcode=$('#postcode').val().toUpperCase();;
//获取纬度和经度
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address=“+number+”“+postcode+”&sensor=false”,
功能(数据){
//插入
$(“#text”).text(数字+”,“+数据.results[0]。格式化的#u地址);
});
});

IE中是否存在错误?如果是,那是什么?这个问题看起来惊人地相似-