首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jquery移动刷新加载映射api v3

问jquery移动刷新加载映射api v3
EN

Stack Overflow用户
提问于 2014-05-07 19:11:27
回答 1查看 475关注 0票数 0

我必须刷新一次页面才能加载地图。您实际上可以查看下面的链接:

http://metartestmobile.netau.net/template/listview.html

当我移动这一行时( <script src="http://code.jquery.com/jquery-1.11.0-beta2.js"></script> )

但我想用这句话..。

这是文件listview.html

代码语言:javascript
复制
<html>
        <head>
            <meta name="viewport" content="width=device-width,initial-scale=1">
            <link rel="stylesheet" href="themes/Bootstrap.css">
            <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile.structure-1.4.0.min.css" />
            <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
            <script src="http://code.jquery.com/jquery-1.11.0-beta2.js"></script>
            <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>
            <div data-role="page" id="my-page" >
                <div data-role="content" data-theme="a">
                    <ul data-role="listview" data-inset="true" data-divider-theme="f">
                        <li data-role="list-divider">Weather</li>
                        <li data-icon="arrow-r"><a href="map.html" data-transition="flip" >Humidity-Rain</a></li>
                    </ul>

                </div>
            </div>
        </body>
    </html>

和map.html

代码语言:javascript
复制
<html>
<head>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <link rel="stylesheet" href="themes/Bootstrap.css">
<script type="text/javascript">
  var infowindow;
  var map;
  function initialize() {
    var myLatlng = new google.maps.LatLng(38.822590,24.653320);
    var myOptions = {
      zoom: 6,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    }
</script>
</head>
<body onload="initialize()">
    <div data-role="content">
        <div id="map_canvas" ></div>    
    </div>

</body>
</html>
EN

回答 1

Stack Overflow用户

发布于 2014-09-01 01:37:26

jquery手机默认使用ajax页面加载。所以改变这个

href="map.html“数据转换=”翻转“

至

href="map.html“数据转换=”翻转“rel=

然后是jquery移动刷新孔页面。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23526297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档