The pushstate function does not work correctly in backbone.js

If I use Backbone with pushstate, how do I format links?

I am currently doing this:

<a href="task/create">create task</a> 

If I use the above format, it actually sends a GET request to the server that serves the standard page, and the trunk correctly identifies that it should go to task/create , what it does and displays the view.

But why does he send a GET request in the first place? (although I set pushstate to true?)

edit: I am using the latest version of Chrome (as of August 2011), so my browser is not a problem, I think.

+8
javascript url html5 pushstate
source share
2 answers

ok got the answer from here. https://github.com/documentcloud/backbone/issues/456

links for links should not be pushstate friendly. you can try to link it through jquery and use a custom function to create this effect.

+4
source share

If other readers need more information about routing, there is a whole chapter dedicated to explaining routing, available on pages 32-46: http://samples.leanpub.com/marionette-gentle-introduction-sample.pdf (full disclosure: I am the author books)

0
source share

All Articles