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

Backbone router getting history length for back-button

I'm using Backbone inside a PhoneGap application. Like every mobile app I need a back-button functionality. It's basically working perfectly with Backbone, because I can simply use window.history.back() and it just works. The only problem I have is…
Prinzhorn
  • 22,120
  • 7
  • 61
  • 65
0
votes
2 answers

Backbone pushstate history not working

I am using backbone.js routes and i am struggling to make history to work. Here is the code i have: $(function() { var AppRouter = Backbone.Router.extend({ routes: { "/": "initHome", "home": "initHome", …
hjuster
  • 3,985
  • 9
  • 34
  • 51
0
votes
1 answer

call a function if no route found

In my application there are 3 routes as defined below everything is working properly but when then the route which is not defined is called, the blank page is displayed. like, if i enter url http://example.com/page.php/#invalidRoute then i got empty…
Jitesh Tukadiya
  • 1,269
  • 1
  • 11
  • 25
0
votes
1 answer

Backbone.js Router implementation

I'm new to Backbone.js and don't exactly understand difference between some types of router implementation. 1. Type: var Workspace = Backbone.Router.extend({ routes:{ '*filter': 'setFilter' }, setFilter:…
Potty
  • 37
  • 5
0
votes
1 answer

Backbone.js - How do load list or individual items from JSON on different routes?

I have just started working with Backbone.js by creating a simple portfolio site for myself. There is not much functionality at the moment but I hope to add more & more as I become familiar with the library. I am using json to populate the data for…
Zander
  • 2,471
  • 3
  • 31
  • 53
0
votes
1 answer

backbone.js history with only one route?

I'm developing my first backbone project and I have requirement that I'm not sure how to meet. I'm sure the solution has something to do with properly routing my app, but I'm not sure... App.Router = Backbone.Router.extend({ initialize:…
Charles
  • 309
  • 1
  • 16
0
votes
1 answer

backbone.js not loading routes

I've been using backbone.js in a few projects now without issue, and I've just started a new project,but for the life of me, I cannot get the routes to load. I'm getting no errors in chrome developer tools, but I also can't get a simple alert to…
pedalpete
  • 21,076
  • 45
  • 128
  • 239
0
votes
1 answer

Whether to use backbone routers/history

I'm creating a collection of backbone powered widgets (for lack of a better word). The consumers will drop the widgets into their web app and initialize them. I have the need to track history for certain pieces of the widgets but don't necessarily…
ryan
  • 6,541
  • 5
  • 43
  • 68
0
votes
1 answer

Trigger and backbone router with file://

I'm working with trigger and backbone, and am trying to programmatically navigate to a url. This is all happening using the file:// protocol, as everything in running inside trigger io only. This manual navigate though doesn't trigger the function…
hashpipe
  • 305
  • 3
  • 16
0
votes
2 answers

Backbone Routing in IE - Get rid of the # sign?

Is there any way to stop # from appearing inside the address bar when using Backbone routing, pushState or not?
0
votes
1 answer

Backbonejs View Rendering Best Approach

I have a sidebar view with a list of items like so SideBarView = Backbone.View.extend( events: "click item": "dosomething" render: //Render item list from a collection ) Now, I am trying to display the sidebar view on two different…
Infinity
  • 3,695
  • 2
  • 27
  • 35
0
votes
1 answer

2 paginations on one page - Backbone Routes

I need to handle 2 separate paginations on one page. At the moment I have only one pagination, the anchors contain just plain hashtags which are parsed by the Route Object like so HTML Backbone Router routes: { …
Julian Krispel-Samsel
  • 7,512
  • 3
  • 33
  • 40
0
votes
1 answer

Backbone: Direct Page Access Without Hash

Answering my own question to an issue I kept running into with Backbone.js... In my Backbone applications, I want users to be able to navigate directly to a an interior "page" without having to type a hash (#) in the URL. Out of the box, Backbone…
cantera
  • 24,479
  • 25
  • 95
  • 138
0
votes
1 answer

Why is my backbone router redirecting to the app root?

I'm using the following router in my app: app.Router = Backbone.Router.extend({ // define the route and function maps for this router routes : { "" : "showLogin", // Sample usage: http://ServerManager/ "login" :…
Evan
  • 456
  • 7
  • 16
0
votes
1 answer

Backbone router with custom default route

I want to initiate a backbone app on the view, which is already rendered by Rails. Here is my router code class App.Routers.Dashboard extends Backbone.Router routes: '': 'index' 'locations/:id': 'showLocation' index: -> alert "Dashboard…
Andrei Varanovich
  • 492
  • 1
  • 5
  • 16