0
你好,我正在創建一個骨幹網頁,我用控制器來激活一些視圖。骨幹保持URL刷新f5
我有這樣的控制器:
var AppRouter = Backbone.Router.extend({
routes: {
"":"main",
"your":"yourpost",
"random" : "randompost",
"featured" : "featuredpost",
"sponsored" : "sponsoredpost",
"post/:pos" : "post",
},
main : function() {
console.log("MAIN_VIEW");
main_view.render();
},
yourposts : function() {
console.log("YOUR_VIEW");
yourpost.refresh();
yourpost.render();
},
...
// Instantiate the router
var app_router = new AppRouter();
// Start Backbone history a neccesary step for bookmarkable URL's
Backbone.history.start();
當我在URL中有一些這樣的:
... /網絡/ index.html的#你
和我按F5鍵,網頁瀏覽器寫:
.../web/index.html#
我的問題是,當我按f5時如何保持url的值?
謝謝!
從來沒有這個問題..你使用什麼瀏覽器? –
我在fedora 17中使用Chrome –
Backbone.history.start({pushState:true}); – opengrid