Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How disable Backbone.js routing on initial page load

I know the best practises says "your content must be available on page load" and i did it so. If user navigates to /questionnaire/info/id/2, PHP serves the full html. But problem raises after this point, backbone.js matches the same route and re-requests the same page and loads it with ajax.

How can i disable backbone for current page's first load?

like image 784
cnkt Avatar asked Jul 20 '12 10:07

cnkt


1 Answers

I found the answer. Just start history with silent: true parameter like this:

Backbone.history.start({pushState: true, silent: true});
like image 164
cnkt Avatar answered Nov 04 '22 01:11

cnkt