Google maps jquerymobile不';不要跟随来自另一个JQM页面的链接
我正在使用jQueryUIMap插件,当我单击按钮时,我的测试页面(test.html)会正确加载Google地图。如果用户从另一个jquery移动页面加载test.html,则该test.html不起作用。我做了什么坏事还是错过了什么?接下来是重要代码: 标头中的Javascript(如基本映射示例中所示): 还有html(很抱歉,我无法发布html代码,因为它已被解释,但链接如下): 正如我所说的,如果我直接在浏览器中编写test.html,这将非常有效,但如果来自另一个页面:Google maps jquerymobile不';不要跟随来自另一个JQM页面的链接,google-maps,jquery-mobile,jquery-ui-map,Google Maps,Jquery Mobile,Jquery Ui Map,我正在使用jQueryUIMap插件,当我单击按钮时,我的测试页面(test.html)会正确加载Google地图。如果用户从另一个jquery移动页面加载test.html,则该test.html不起作用。我做了什么坏事还是错过了什么?接下来是重要代码: 标头中的Javascript(如基本映射示例中所示): 还有html(很抱歉,我无法发布html代码,因为它已被解释,但链接如下): 正如我所说的,如果我直接在浏览器中编写test.html,这将非常有效,但如果来自另一个页面: 它只是忽
它只是忽略“单击”或触摸按钮以显示地图。提前感谢您的帮助。我在您的代码中看到的一个问题是如何使用
live
。建议将live
替换为on
var mobileDemo = { 'center': '57.7973333,12.0502107', 'zoom': 10 };
$('#basic_map').live('pageinit', function() {
demo.add('basic_map', function() {
$('#map_canvas').gmap({
'center': mobileDemo.center,
'zoom': mobileDemo.zoom,
'disableDefaultUI':true,
'callback': function() {
var self = this;
self.addMarker({'position': this.get('map').getCenter() }).click(function() {
self.openInfoWindow({ 'content': 'Hello World!' }, this);
});
}});
}).load('basic_map');
});
$('#basic_map').live('pageshow', function() {
demo.add('basic_map', function() { $('#map_canvas').gmap('refresh'); }).load('basic_map');
});