使用Backbone.history回去 [英] Using Backbone.history to go back
问题描述
我继承了使用Backbone.js的(我从来没有用过)。内置半成品的移动应用程序
I have inherited a half-finished mobile app built using Backbone.js (which I have never used).
我需要的,很简单,向用户发送回当他们点击后退按钮。
I need, quite simply, to send the user back when they click a back button.
一些简单的研究使我相信它是与 Backbone.history
,但我想不出什么。
Some brief research leads me to believe it has something to do with Backbone.history
but I can't figure out what.
任何想法?
推荐答案
除非应用程序使用花式schmancy HTML5的 pushState的
事件,我看不出有需要的 Backbone.History
在这里。只需使用<一个href=\"https://developer.mozilla.org/en/DOM/window.history#back\"><$c$c>window.history.back()$c$c>.
Unless the app uses the fancy-schmancy HTML5 pushState
events, I don't see a need for Backbone.History
here. Just use window.history.back()
.
这篇关于使用Backbone.history回去的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!