javascript - Default path problem in backbone.js -
i'm trying create first bb app. it's going ok have problem. router looks this:
var playersapprouter = backbone.router.extend({ routes: { '': 'index', }, initialize: function () { this.model = new playersappmodel({}); this.view = new playersappview({model: this.model}); }, index: function () { alert('it works'); //<-- doesn't }, });
and later in code have:
$(function () { window.app = new playersapprouter; backbone.history.start({pushstate: true}); app.model.players.reset(<?php require('players.php'); ?>); //<-- players.php loads bunch of json data. });
now, why doesn't index action of router fire? doing wrong? there other problems code?
the full app can found here: http://development.zeta-two.com/development/f14/
get rid of pushstate:true @ works
http://fiddle.jshell.net/r5tek/9/show/
there maybe bug pushsate. see here
Comments
Post a Comment