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

Backbone.Router accept query and path

I want that my Backbone.Router instance listens on hashbangs like '#/settings' and '#/settings/privacy' Currently I handle this problem this way: var Router = Backbone.Router.extend({ routes: { "settings": "settings", …
bodokaiser
  • 15,122
  • 22
  • 97
  • 140
0
votes
1 answer

Backbone JS: Routes with empty parameters

I have a route. routes: { "example/=q:query": "example_main" } This: localhost/site/#example/q=hello works perfectly but if the URL is: localhost/site/#example/q= My router does not understand it and no action is performed. Does anyone know…
0
votes
2 answers

BackboneJS Routing

My app's index page is at http://cms/admin (I'm on localhost). On the index page there is only one a element: deneme When i click on the link it goes to /cms/admin/test I want to use BackboneJS's routing mechanism to…
cnkt
  • 2,943
  • 5
  • 30
  • 43
0
votes
1 answer

How to properly switch between complex Backbone Apps in a One-Page App

I'm having several complex views/apps that all together form one big app. Think of gmail, where you have mail and contacts Or twitter, switching from profile view to settings In my case, it's a game where you can have a view to play and a map…
Xosofox
  • 840
  • 1
  • 7
  • 21
0
votes
1 answer

Backbone.js paging, remove page number from Backbone.history.fragment

I want to create page navigation for my app written in Backbone. when I want to create the page navigation, I'm having problem with creating the URL. some_page_number because …
bbnn
  • 3,505
  • 10
  • 50
  • 68
0
votes
1 answer

Specifying root url with param like :id in Backbone.js and ability to access it

Hi I want to make my root url have a :id segment like below which should be passed as param to every route that matches it Backbone.history.start({ pushState: false, root: "/orders/:id/items"}) routes: { "": "item" }, item: function(id) { …
Peru
  • 383
  • 2
  • 13
0
votes
1 answer

Trouble accessing attributes in the template - all attributes apart from 'name' show error '[attributename] is not defined'

The problem is that all Object attributes apart from 'name' call the error 'id/url/whatever is not defined' in the console when accessed from the template. A template with just 'name' displays fine and shows the correct name, but as soon as I call a…
0
votes
1 answer

Backbone application with routes from a static json file (read-only)?

I'm building a read only backbone app with data (sourced from a single static json file) that follows a building/campus structure of sort. That is: [{ "name": "Building Name", "id": "building", "floors":[{ "name":"Ground Floor", …
0
votes
1 answer

How to handle back using Backbone.js? Or how to render the earlier visited page without making call to fetch again?

I am creating a web app using backbone.js in which there are multiple views which are rendering fine. The main problem is handling the back button event. When i press a back button the earler view renders properly but by following the same process…
Jitu
  • 284
  • 1
  • 3
  • 15
0
votes
1 answer

How can you suppress click events of # hrefs?

I would like to auto suppress click events when the link href is a hash (#). I don't want to have to stop the event with e.preventDefault() within each view. How can you stop click events application wide for # hrefs?
imrane
  • 1,542
  • 2
  • 16
  • 29
0
votes
2 answers

backbone.js each collection in view

If I loop the collection in the view, it's seems empty, alert dialog don't show up. When I use console.log(this.collection) in this view, it's look ok (16 element in this collection). My router: (collection url: '/api/employees', this is a rails…
0
votes
1 answer

Backbone router configuration on dynamic page

I have a php page that is loaded up via a get request and contains multiple params like: index.php?page=6&name=Virginia. Once the page is loaded I then initalize backbone and am using it to render views on a portion of the page. The problem is…
user398746
0
votes
1 answer

Backbone.js router - route with splat also calls route with no splat

I have a backbone.js router set up with some routes as follows : routes : { 'a-route' : 'goToRoute', 'a-route/*splat' : 'goToRoute' } goToRoute : function(splat){ if(!splat) { // do this } else { // do that with splat } When I do a…
Petrov
  • 4,200
  • 6
  • 40
  • 61
0
votes
1 answer

passing url as hashmaps in backbone route?

I'm trying to pass a directory location and the file path as part of the hashmaps in backbone routes. This is the url with hashmaps: localhost/index.html#directory-http://localhost/foobar-html/foo.html and this is what my route that maps the above…
codef0rmer
  • 10,284
  • 9
  • 53
  • 76
0
votes
2 answers

Backbone Routers, URLs and Test/Production Web Contexts

In my Backbone application I have a main view that shows previews of posts. When the user clicks on a post, the post is expanded in an overlay and the URL is changed to reflect that post. While the post is expanded the user may do something that…
threejeez
  • 2,314
  • 6
  • 30
  • 51
1 2 3
27
28