Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm quite new to backbone.js and trying to convert a normal javascript/jquery application into backbone MVC. With it I came of Backbone.Router and I'm currently trying to solve my old URL handling with backbone, but there some problems I'd like to discuss with you:

My traditional URL pattern looks like this:

/#/lang=1&page=panorama&cats=13,3,4,6,7,8,9,10,11&pid=4

How could this look like with backbone and how to code it?

The thing is, that my traditional handling allowed me to evaluate my URL string with not caring about the order of the parameters. With backbone this seems not to be possible. For my application its like necessary to pass categories (see cats=..) and so on in the url, to link to a specific app position/state.

I already tried it with the pid (panorama-id), so the patters is like:

/panorama/:id

"panorama" is currently no parameter, but stand for a certain page in the application.

I would be really thankful if someone has got a solution for me.

share|improve this question
    
What are the categories used for? Would it be possible to set up some type of global object, like window.Categories that would keep track of the categories selected? (I don't know enough about the backbone router and that was the firs thing that came to mind) –  CamelBlues Aug 28 '12 at 19:02
    
While further researches in the last minutes I found that plugin for backbone: github.com/jhudson8/backbone-query-parameters Looks really great and I think it has got the functionality I was looking for. If it wont be the thing I looked for, I'll ask again :) –  tellob Aug 28 '12 at 19:07

1 Answer 1

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.