我正在嘗試做一些非常簡單的事情。骨幹路由器as/en /#xyz而不是/#en/xyz
這裏是場景: 我有一個完整的網站,與pushstate啓用瀏覽器很好的工作。該網站關閉工作的基礎上,該語言是「實際頁」,例如:
/en/whatever/etc = index.en.php with with english headers and encoding & tweaks
/ar/whatever/etc = index.ar.php with with arabic headers and encoding & tweaks
/ru/whatever/etc = index.ru.php with with russian headers and encoding & tweaks
這真的光滑,正如我所提到用pushState的作品很好。問題是當我嘗試使用散列替代方法使用相同的路由器代碼時。
骨幹路由器似乎想做到這一點:
/#/en/whatever/etc = bad because it's not based correctly
/#/ar/whatever/etc = and so on
什麼,我希望它做的是:
/en/#whatever/etc
/ar/#whatever/etc
/ru/#whatever/etc
..and so on
or even:
/en/#/whatever/etc
/ar/#/whatever/etc
/ru/#/whatever/etc
..and so on
但我找不到不扭捏骨幹源來實現這樣的方式。我很反對改變backbone.js,除非我真的必須因爲未來的防禦因素。
任何人有任何想法?
嘿感謝你救了我tkone:
這將導致您的網址是!我將不得不開始發送你的鈔票,而不是點數---) – Alex 2012-04-10 11:18:20
@亞歷哈哈沒有問題。很高興爲您服務! – tkone 2012-04-10 12:53:06