olivernn / davis.js

RESTful degradable JavaScript routing using pushState
http://davisjs.com
532 stars 58 forks source link

Setting to ignore route if from back & external page? #73

Open mellinger opened 11 years ago

mellinger commented 11 years ago

Awesomely useful plugin, but I'm in a bit of a bind with this scenario:

1) Server can render pages identically to the ones rendered by the client. 2) Lots of links to external pages that are outside of Davis.js 3) User clicks on an external page link, hits back, server renders the page properly then Davis.js triggers a route and re-renders it a second time.

Any ideas for getting Davis.js to recognize this situation and not route?

Any help would be appreciated! Max

mellinger commented 11 years ago

OK, researched the issue further and realized it's a result of the whole "webkit firing pop state on page load" issue. I fixed it by disabling actions on pop, which works in my case. I also tried setting generateRequestOnPageLoad = false, but that didn't seem to have an effect. Weird?