I'm using the Backbone.js framework and I'm using the routers to create urls on my page.
It turns out that I think I already have it, but when I open the Chrome console it says the following:
backbone.js:7 Uncaught SyntaxError: Unexpected string
It's weird because I use the same patterns as in the examples I found.
I leave the code:
(function(){
var Router = Backbone.Router.extend({
routes: {
"boton1/:id" : "vistauno"
"boton2/:id" : "vistados"
"boton3/:id" : "vistatres"
},
vistauno: function (boton1) {
console.log("estas intentando acceder a "+boton1);
},
vistados: function (boton2) {
console.log("estas intentando acceder a "+boton2);
},
vistatres: function (boton3) {
console.log("estas intentando acceder a "+boton3);
}
});
var Router = new Router();
Backbone.history.start();
})();
The error seems to be in line 7, in "boton2/:id" : "vistados"
, but I find it strange because all the examples that I have looked at do the same ..