Questions tagged [backbone-routing]

Backbone.js is a JavaScript framework that provides structure to RESTful web applications. Backbone also includes URL fragment or History-based routing. This tag is for questions related to Backbone's routing system.

From the fine manual:

Web applications often provide linkable, bookmarkable, shareable URLs for important locations in the app. Until recently, hash fragments (#page) were used to provide these permalinks, but with the arrival of the History API, it's now possible to use standard URLs (/page). Backbone.Router provides methods for routing client-side pages, and connecting them to actions and events. For browsers which don't yet support the History API, the Router handles graceful fallback and transparent translation to the fragment version of the URL.

419 questions
0
votes
1 answer

How does the AngularJS router work for wildcards and pushstate?

We are investigating a migration from Backbone to Angular. Because of our design, we only need to migrate the router. I'd like to understand how wildcard routing works for angular. Here is an example of wildcard routing in Backbone: app.Router =…
JStark
  • 2,788
  • 2
  • 29
  • 37
0
votes
0 answers

backbone router path settings

I have a path configured for my backbone router as var myApp = myApp || {}; myApp.router = Backbone.Router.extend({ routes:{ "somecontent_:id": "content", "":"defaultPath" }, defaultPath: function(){ //default path …
paul
  • 1,124
  • 9
  • 27
  • 45
0
votes
2 answers

Using the initialize function in Backbone Router

I'm in the midst of creating my first backbone app using Node/express and Mongodb. The app is an online food menu and ordering system that collects all the data from mongo on the first page load and pushes it into a Backbone collection. I'm using…
0
votes
0 answers

Backbone.js: Disallow backbone history

I came on this site to research a problem that I've been having regarding negating Backbone.js's history for certain elements. Thankfully, I came across this answer: here. While it had provided a solution for me, the ultimate result was partial.…
incarnate
  • 145
  • 3
  • 13
0
votes
1 answer

Strange behaviour of this in backbone.js Controller

Yes I am new to JS and also in backbonejs. Lets dig into the problem now. I am having a very strange behaviour of this in backbonejs Controller. Here is the code of my controller var controller = Backbone.Controller.extend( { _index: null, …
MD. Sahib Bin Mahboob
  • 20,246
  • 2
  • 23
  • 45
0
votes
2 answers

URL in backbone.js single page app gets way too long (~98'000 characters)

I have a JavaScript single page app (using backbone.js), where the app's state is stored as part of URL parameters. This webpage has a lot of checkboxes. So if a user hits a URL like…
0
votes
1 answer

Backbone.js initializing multiple router.js files

I am using Backbone.js require.js underscore.js to build an application. In my javascript, i have my mainrouter.js file which deals with the menu selection. The application is broken into several sections and i wanted to have a sectionRouter.js file…
0
votes
1 answer

Application structure in backbone and requirejs app

I am developing a app using backbone and requirejs. I have structured the app like this: A main index.html file having In app.js i do like this: require.config({ …
beNerd
  • 3,314
  • 6
  • 54
  • 92
0
votes
1 answer

Backbone routes and view states

Apologies for the possibly poorly formulated title. New to Backbone. I'm having trouble wrapping my head around how to deal with routes in association with views. Basically I have a view (let's call it ListView) that, depending on its viewMode,…
jdlm
  • 6,327
  • 5
  • 29
  • 49
0
votes
1 answer

still the navigate triggers and upate my url, the method is not calling

In my backbone app, i use the requirejs to load the js files. as well i need different views, there is no.of links are there in my drop down menu. according to the drop down menu i a adding the #url…
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
0
votes
1 answer

Handing cold navigation to internal URL in Backbone?

I'm wondering how people handle the following case in Backbone: usually when a user navigates to the root of your app, a certain set of data is loaded from the backend, processed right away and then displayed in the DOM. There are links in the app…
Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76
0
votes
0 answers

How to call a root handler from the router?

I have a Router code: var HellospaceRouter = Backbone.Router.extend({ routes: { "" : "root", "signup": "signup", "login" : "login" } }); These handlers change the model state. Changing the state of the…
ReklatsMasters
  • 708
  • 9
  • 20
0
votes
1 answer

router function not triggering

In my backbone function, i am navigating a id to routers, but the function not calling... as well i have given the different sample navigate urls to my links, those are not calling the functions.. mycode : (function($){ var myRouter =…
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
0
votes
2 answers

Backbonejs: Organizing Routes

How do yo organize your route object if there's too much routes inside it, let's say a hundred. Do you just put it in a single file or object? Thanks.
Barry
  • 1,587
  • 2
  • 13
  • 19
0
votes
1 answer

Ajax results filtering and URL parameters

I am building a results filtering page using AJAX requests. I would like to reflect the filters in the URL. For example: for price_from I want to add ?price_from=VAL to the URL. I have a backend that is capable of rendering the page with URL…
jenda
  • 42
  • 7