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
1 answer

Backbone router only triggering first time, not working after resubmit?

All, I am using a router with "#search" to start initiate a collection fetch from another view. **Router code** // DesktopRouter.js // ---------------- define(["jquery", "backbone", "views/Page", "views/Form", "views/Results"], …
tomaytotomato
  • 3,788
  • 16
  • 64
  • 119
2
votes
1 answer

Backbone sent userinfo after login

I'm making some kind of pinterest backbone application. (post pics/vids/text etc to remember later) It is the first time I try to make a register/login in backbone. I have a homeView and an OverviewView at the moment. If a user registers now I use…
2
votes
0 answers

Backbone router: Assemble complete url from route and parameters

I'm using the 'before' function in Backbone's router to intercept route changes so I can check client side authentication: routes() { return { 'search/:query/:page': 'search', }; } before(route, args) { if…
user888734
  • 3,797
  • 5
  • 36
  • 67
2
votes
2 answers

How to destroy previously created view instance while creating the new instance for the same view in Backbone.js

I am using Backbone.js in my project. I have created a new instance of a view in a render function of another view render: function (data) { var newView = new View(); } need to call same render function again and again without refreshing the…
2
votes
2 answers

Backbone: abort previous router callback execution

Suppose I have 2 links on my page: Link A Link B And I use backbone router to handle in-app page navigation. On routing link '#A', I have registered a listenerA and similarly listenerB for '#B' where both listenerA…
2
votes
1 answer

Backbone Router route definition to handle all these conditions

What I would like is a route that can handle all the following routes in 1 line. Currently it looks like this: routes: { 'item': 'itemConsole', 'item/view/:workflowId': 'itemDetail', 'item/create': 'itemCreate', 'item/create/:templateId':…
Mike Fielden
  • 10,055
  • 14
  • 59
  • 99
2
votes
1 answer

attaching a view rather than showing it on application startup

I have a Marionette App that is roughly set up in this fashion (irrelevant pieces omitted): App = new Marionette.Application(); App.addRegions({ mainRegion: '#main-region' }); App.AppRouter = Marionette.AppRouter.extend({ appRoutes: { …
kinakuta
  • 9,029
  • 1
  • 39
  • 48
2
votes
2 answers

Clean up requests and callbacks when switching routes

I have a backbone app that loads some data from an API into a chart. This app has several tabs that can be navigated through to access these different charts, and every tab executes a route. Every chart is an instance of ChartView with the…
jaapz
  • 989
  • 8
  • 26
2
votes
1 answer

login form POST parameters in Backbone JS

I am trying to build a sign in system using Backbone JS. Here is a brief description of the API: HTTP Method: POST Request type: JSON Parameters: a) user[email] b) user[password] Response: 1)- Success: a- :status => OK 2) Failure: :status…
2
votes
1 answer

in-page anchor with backbone

Hi everyone, I am developing a backbone app and I went through one "big" problem, I can't find any useful thinking on internet but I can't imagine I am the only one to have this problem. I just want to use basic in-page anchor with backbone like old…
jdmry
  • 53
  • 5
2
votes
1 answer

Router instance differing in BackboneJS

What is the difference between use as this.initialize(); within router.js in BackboneJS and require(['router'],function(Router) { router = Router; router.intialize(); }); How to get same instances? Can any…
user3428816
  • 1,241
  • 3
  • 16
  • 32
2
votes
4 answers

How the Backbone Marionette JS router works

I am new to Backbone Marionette JS and wondering how its routing works. Is any one can explain me or point me to the right direction to look at it. Thanks in advance.
modon
  • 241
  • 3
  • 7
  • 14
2
votes
1 answer

Emberjs: complicated routes (query params)?

Can I do a complicated route (query params) with emberjs? I am still not sure if I want to go for emberjs as I have my app's routing established on backbonejs already. Just need to be sure before switching... For instance if I use…
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
2 answers

Backbonejs routing VS emberjs routing

This is how I do my routes in backbonejs where the routing and its params are obtained first before deciding which external template to call. I find this is quite flexible. var Router = Backbone.Router.extend({ routes: { //'': …
Run
  • 54,938
  • 169
  • 450
  • 748
2
votes
2 answers

How to decode in JavaScript a URL encoded in PHP?

I'm using PHP to encode a Url and after that I'm using the Url in Javascript for filling the title of a Bootstrap modal I have something like this when I encode in…
ppollono
  • 3,421
  • 1
  • 19
  • 29