Routing problems with Codeigniter and Backbone.js

后端 未结 2 1872
-上瘾入骨i
-上瘾入骨i 2021-02-06 14:18

Here are the frameworks I am using:

  • Codeigniter
  • Codeigniter REST API
  • Require.js
  • Backbone.js

Runn

2条回答
  •  失恋的感觉
    2021-02-06 15:02

    If you're not already doing it, you may want to route via Backbone through the hashtag changes (it's his normal behavior, pushState: false), as modifying the hashtag would in no way result in a server call, thus ignoring Codeigniter's router.
    In your example, you would want to navigate to localhost/#otherPage.
    Then use Codeigniter's router for your ajax REST calls.

提交回复
热议问题