【问题标题】:Changing URL using backbone.js使用backbone.js 更改URL
【发布时间】:2017-12-19 09:06:40
【问题描述】:

我查看我的主干模块

http://localhost/src/index.html#test_module

网址。 但我需要查看另一个模块,例如

http://localhost/src/index.html#test_module/another_module

注意:

我的主干视图正在使用Backbone.history.navigate(another_module, {trigger:true});,但它给了我一个类似的 URL

http://localhost/src/index.html#another_module

【问题讨论】:

标签: javascript backbone.js


【解决方案1】:

你为什么不这样尝试。

Backbone.history.navigate("test_module/another_module", { trigger: true });

阅读documentation on navigate了解更多信息。

【讨论】:

    【解决方案2】:

    在使用主干进行开发时,您应该使用Backbone Routers 作为最佳选择。您可以通读文档以获得更好的理解。

    【讨论】:

      猜你喜欢
      • 2013-06-24
      • 1970-01-01
      • 1970-01-01
      • 2012-10-12
      • 2015-11-18
      • 2012-11-24
      • 1970-01-01
      • 1970-01-01
      • 2013-07-07
      相关资源
      最近更新 更多