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
2
votes
2 answers

Backbone.js router triggering on put, not on post

So I have been working with basic Backbone.js to create a simple demo page that is a basic User Manager. I run the same function whether I am creating (POST) or updating (PUT) a user's information. Both the POST and PUT requests are successful (I.E.…
MelArlo
  • 157
  • 9
2
votes
2 answers

Routing & events - backboneJS

How should I be handling routing in BackboneJS? When routing, after new-upping my view, should I be triggering an event, or rendering the view directly? Here are the two scenarios: Trigger Event: routes: { 'orders/view/:orderId' :…
Scott Silvi
  • 3,059
  • 5
  • 40
  • 63
2
votes
1 answer

How can I get consistent PushState links between IE8 and IE10/modern browsers with backbone.js?

I'm in Chrome, I copy my url: "http://www.example.com/a/123456789" and paste it into IE8. It works fine, because my routes are set up right. If I then navigate somewhere else, I get the IE8 fallback url as expected:…
Alex K
  • 14,893
  • 4
  • 31
  • 32
2
votes
1 answer

How to implement Backbone boilerplate with views

I am trying to learn backbone, however truth be told, I'm feeling a little overwhelmed. Everywhere I look it is being done in a slightly different way, each with more frameworks and plugins to learn. So I have decided to put my faith in Addy Osmani…
2
votes
1 answer

Backbone view organization and partials

I have a rather complex Backbone application and I'm not sure how to organize the views/templates. The application is a web-based email client. I'm really having trouble understanding how to make this sidebar. The application sidebar is very similar…
sethvargo
  • 26,739
  • 10
  • 86
  • 156
2
votes
1 answer

Backbone routes with optional '/'s and query parameters

Would like to set up a backbone route that matches a url that looks like this an all of its "intuitive" derivatives" Base format: http://www.domain.com/PageName/:argument Example: http://www.domain.com/PageName/1234567890 The "intuitive"…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
2
votes
1 answer

backbone.js - map standard url parameters - use multiple parameters

I'm quite new to backbone.js and trying to convert a normal javascript/jquery application into backbone MVC. With it I came of Backbone.Router and I'm currently trying to solve my old URL handling with backbone, but there some problems I'd like to…
tellob
  • 1,220
  • 3
  • 16
  • 32
2
votes
1 answer

Backbone.js and navigation

Since backbone does not have its way of doing most things, i am confused on a lot of stuff. One of that things is the right way to navigate through my app. I realize that a BB Router has a '.navigate' method which can be used to push urls and…
Drazen
  • 2,776
  • 1
  • 25
  • 39
2
votes
1 answer

Backbone.js router pattern for different response to browser "back" button or direct navigation

Is there a good pattern for implementing a Backbone.js Router that responds differently for these two events: Direct navigation - A user navigates directly to page by putting the url directly into the browser or in the application via a call to…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
2
votes
2 answers

Backbone.js and rails Code organization

I am working on a app that has multiple types of users, each user has a separate view when they are logged in. for example a business type user will create his profile upload photos etc, create some other stuff. and then the content created by…
2
votes
1 answer

backbone router globbing non backbone routes

I'm using devise, rails with backbone. All my backbone routes are working just fine. But non-backbone routes like /accounts/login that are supposed to rendered by rails are being globbed with backbone router. SS.Routers.ApplicationRouter =…
user689541
  • 21
  • 2
2
votes
1 answer

Backbone boilerplate running on MAMP, cant get the router to work

I'm currently using backbone boilerplate and running it on my MAMP server localhost. I can't seem to get router to work require([ // Global "app", // Libs "jquery", "backbone" ], function(app, $, Backbone) { // Defining the…
mcclennon19
  • 623
  • 2
  • 6
  • 21
2
votes
1 answer

Opening a new view in a new window

Let's suppose I have a web application made with Backbone, which use Backbone.Router for routing client-side pages. Let's suppose the page layout looks like this: link_1 | link_2 | Right link_2 | And the Router is the following: routes: { …
Lorraine Bernard
  • 13,000
  • 23
  • 82
  • 134
2
votes
1 answer

Backbone.js routes don't fire correctly

My code is as follow: var AppRouter = Backbone.Router.extend({ _data: null, _length: 0, _index: null, _todos: null, routes: { "*action": "index", "category/:name": "hashcategory" }, initialize:…
chaonextdoor
  • 5,019
  • 15
  • 44
  • 61
1
vote
1 answer

My Backbone Routing forgets everything when I hit the browser refresh button

I have an older web app that is a mix of Backbone and .Net 6. When I first start the app in Visual Studio 2022 for development, it loads fine and everything works great. I use Backbone routing and a helper library called backbone.subroute for all my…
SkyeBoniwell
  • 6,345
  • 12
  • 81
  • 185