dongzhuohan7085 2014-02-11 20:37
浏览 29

jquery ajax调用谷歌地图保持页面加载

I know I didn't use the right terminology here but when I load this page, in the upper left in Firefox it says the data is still trying to load, yet it shows me the right data.

Why would this script below cause this error and not complete the call?

Second question: What are the best terms to describe this action of "not loading" and still showing the spinning icon in browser?

Here is the full code:

<?

$geoLong = $_POST[geoLong];
$geoLat = $_POST[geoLat];



?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$( document ).ready(function() 
{
    $.ajax({ url:'http://maps.googleapis.com/maps/api/geocode/json?latlng=<? echo "$geoLong,$geoLat";?>&sensor=true',
             success: function(data){
                 document.write("City="+data.results[0].address_components[3].long_name);
                 document.write("&Country="+data.results[0].address_components[6].long_name);
                 /*or you could iterate the components for only the city and state*/
                  }
    });

});

</script>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 三种调度算法报错 有实例
    • ¥15 关于#python#的问题,请各位专家解答!
    • ¥200 询问:python实现大地主题正反算的程序设计,有偿
    • ¥15 smptlib使用465端口发送邮件失败
    • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
    • ¥15 对于squad数据集的基于bert模型的微调
    • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
    • ¥20 steam下载游戏占用内存
    • ¥15 CST保存项目时失败
    • ¥20 java在应用程序里获取不到扬声器设备