我正在使用骨干Js开发phonegap应用程序。为了启用back按钮功能,我使用了Backbone.history.start();。
对于一个场景,我想清除所有的应用程序历史记录,并使back按钮功能无效。
如果有人愿意回答,那就太好了。
提前谢谢。
发布于 2013-10-22 10:59:14
通过检查主干源代码,我发现可以使用Backbone.history禁用Backbone.history.stop();,因此这可能会给您带来预期的行为。
// Disable Backbone.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function() {
Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
clearInterval(this._checkUrlInterval);
History.started = false;
},https://stackoverflow.com/questions/19514295
复制相似问题