我知道以前有人问过这个问题,但我没有看到任何解决方案:
因此,我使用Cordova 2.5在iOS 6.1.2上构建iPad应用程序
我的app.coffee:
jQuery ->
class window.AppRouter extends Backbone.Router
routes: {
'': 'index',
':parent/:child/': 'childView',
':id/': 'detailView',
},
index: =>
$("#navbar .title").text("Flight Centre's Choices")
view = new fc.main.View
view.render()
childView: (parent, child) =>
view = new fc.main.View(parent:parent, child:child)
view.render()
detailView: (id) =>
view = new fc.main.Detail(id:id)
view.render()
window.app = new AppRouter();
Backbone.history.start();
第一个索引视图成功加载并按预期显示
现在点击其中一个链接来打开childView,它无法加载页面:
2013-03-20 16:56:13.684 Flight[1158:907] Resetting plugins due to page load.
2013-03-20 16:56:13.689 Flight[1158:907] Resetting plugins due to page load.
2013-03-20 16:56:13.694 Flight[1158:907] Failed to load webpage with error: Frame load interrupted
用户单击的链接如下所示:
/#/foo/bar/
在我的Mac上,Chrome浏览器中一切都按预期运行。
我不知道这里发生了什么!!
2条答案
按热度按时间ojsjcaue1#
该死的这腰分很多时间,答案是如此愚蠢和简单。
而不是将html中的链接设置为:
它应该只是
这是有道理的,与前导/页面将重新加载,这就是为什么我得到了这个错误。
希望能帮到一些人
dgtucam12#
我可以通过使用window.location.hash来解决这个问题。