javascript - getting backbone to serve static html files -
here directory structure on server
public/js/...
/css/... /img/... /demo /demo/button/index.html /demo/slider/index.html /demo/dialogbox/index.html
in normal backbone route handler, need create view object in which, there model. model fetch data rest api upon initialization. when comes static pages, bit confused since still in learning stage.
question:
how configure backbone router serve static html pages under demo folder?
simple answer: don't.
the (simplified) way website (using backbone) works is:
- client requests page web server
- web server sends page (sometimes including backobne app)
- client receives web page, web browser renders page (executing backbone code, if any)
- backbone router handles hash changes , updates data on page (possibly making ajax requests), without ever requesting new page server
backbone doesn't static pages: client requests them (e.g. clicking on link), , web server sends them. in other words, follows steps above, stops @ step 3.
Comments
Post a Comment