Random JavaScript question

kittenSolved! Special thanks to @Japh and John Blackbourne for figuring out where I went wrong 🙂

I’m trying to abstract some strings from a JavaScript file, but I can’t get it to work. I’m hoping some kind soul somewhere out there on the interwebz can tell me what stupidly obvious thing I am missing.

The code is buried in something which is manipulating a Backbone.js script. No matter what I do, I can’t use a variable with the “routes” section and am not sure how to work around that. You can see an example with the “blabla” variable below:

var blabla = 'boober';
// Sets up the routes events for relevant url queries
themes.Router = Backbone.Router.extend({
	routes: {
		blabla: 'this should be a boober',
		'test': 'test',
		'another-test': 'yes it is a test'

Any ideas on how this works and how I can go about working around it?

I don’t really understand the syntax used there, which is probably not helping my understanding of it :/

Big thanks to anyone who is able to assist me in figuring this out 🙂

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *