If I enable pushState in the backbone router, do I need to use return false on all links or does backbone handle this automatically? Is there any samples out there, both the html part and the script part.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the pattern Tim Branyen uses in his boilerplate:
Using that, rather than individually doing preventDefault on links, you let the router handle them by default and make exceptions by having a
data-bypassattribute. In my experience it works well as a pattern. I don’t know of any great examples around, but trying it out yourself should not be too hard. Backbone’s beauty lies in its simplicity 😉