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
6
votes
3 answers

Backbone router for two dimensional menu: advice

I am a very beginner in backbone.js. My page navigation looks like this: The left navigation defines four view types, while the top navigation should update the datamodel and re-render the current view (that's what I have in mind). I want to…
html_programmer
  • 18,126
  • 18
  • 85
  • 158
6
votes
1 answer

redirect route to another

I am trying to redirect route to another before route callback is executed. I have following piece of code: console.log("file loaded"); (function (History) { var _navigate = History.prototype.navigate; _.extend(History.prototype, { …
user606521
  • 14,486
  • 30
  • 113
  • 204
6
votes
3 answers

Backbone Router in IE

I am using the Backbone.js router to fire certain initialization methods when the user hits certain URL routes. So going to /posts/1 via a vanilla anchor tag should fire whatever callback is associated with /posts/:id in my Backbone router. This…
Squirkle
  • 933
  • 1
  • 7
  • 22
6
votes
1 answer

Bootstrap scrollspy and backbone routing

How would i go about using Bootstrap's Scrollspy when I am using Backbone.js hash based routing? Backbone router example, which creates page www.example.com/#somePage/123 var AppRouter = Backbone.Router.extend({ routes: { "": "home", …
abritez
  • 2,616
  • 3
  • 29
  • 36
5
votes
1 answer

Backbone.js Router doesn't fire on page init

i have a quite simple backbone router and everything works fine so far. Except when i reload/direct enter the url i.e. http://mydomain.com/#list/50fadc41125b0 I've tried nearly everything now without any positiv results at all. myRouter =…
Horst
  • 407
  • 5
  • 17
5
votes
2 answers

Optional route parameters in Backbone.js? (again)

I'm trying to set up routing in Backbone 0.9.10. I'd like to match routes of the following kind: /england/ /england/birmingham /france /france/paris ... etc. This is what I have in my router at the moment: var AppRouter =…
Richard
  • 62,943
  • 126
  • 334
  • 542
5
votes
1 answer

backbone.js routing when query passed to route contains /

My app basically takes some form input and returns a set of results. I have two routes routes: { '': 'search', 'search': 'search', 'results/:query': 'results' }, results: function(query) { var search = new…
Charles
  • 309
  • 1
  • 16
5
votes
3 answers

Backbone Route is not called

I have a working app using Backbone 0.5.3, which is no longer working using backbone 0.9.2. I identified that Router.navigate() doesn't call my route for some reason. Here's my Router: var Router = Backbone.Router.extend({ routes: { …
Achim Koellner
  • 913
  • 12
  • 22
5
votes
2 answers

How do I create dynamic URL's with Meteor?

I'm new to web dev and was blown away by the demo on Meteor's site and would like to use it. I've only used Google App Engine so far and to handle a dynamic URL in the main class I would write something like this: app =…
Zaheer
  • 2,794
  • 5
  • 28
  • 33
5
votes
2 answers

Managing views with routers in Backbone.js

I am working in a single page app that has the following layout: I am using a Backbone.js router to manage the elements that load on the screen: var AppRouter = Backbone.Router.extend({ routes: { "" : "list", …
rpabon
  • 1,191
  • 2
  • 16
  • 22
4
votes
4 answers

Backbone.js won't route to same URL as current one

I am facing a problem with navigating/routing the URL. Say for example, I am currently in #contact/new and again I am requesting the same url then its not calling the respective function. I need to change the URL to for example #contact/edit and…
Kishan
  • 71
  • 3
  • 8
4
votes
1 answer

Exclamation Mark in Backbone Router routes

In our project we have a bunch of routes such that the original route: routeAction is followed by !route: routeAction like so.. 'home': 'homeAction', '!home': 'homeAction', No one on the team knows why we do this. Anyone here know? Can't find…
trebek1
  • 755
  • 1
  • 8
  • 28
4
votes
1 answer

how to switch views with the backbone.js router?

This is more of a conceptual question, in terms of using the backbone router and rendering views in backbone. for the sake of an example (what I'm building to learn this with) I've got a basic CRUD app for contacts, with create form, a listing of…
bigmadwolf
  • 3,419
  • 3
  • 30
  • 44
4
votes
5 answers

Backbone and jqm: back button how to restore page context

I'm building an HTML5 mobile application using Backbone, require and jQuery mobile as a technology stack. The application is really smoothy with a connection to a backend web service and so on. To Change between the pages I use jQuery…
1
2
3
27 28