代码之家  ›  专栏  ›  技术社区  ›  MeseleŞuki

使用主干更改URL。js公司

  •  -1
  • MeseleŞuki  · 技术社区  · 7 年前

    我使用查看我的主干模块

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

    URL。 但我需要查看另一个模块,如

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

    注:

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

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

    2 回复  |  直到 7 年前
        1
  •  1
  •   Emile Bergeron Dhaval Rajpara    7 年前

    你为什么不这样试试呢。

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

    阅读 documentation on navigate 更多信息。

        2
  •  -1
  •   sSD    7 年前

    您应该使用 Backbone Routers 作为使用主干网开发时的最佳应用程序。您可以通读文档以更好地理解。