pushStatesupportexistsonapurelyopt-inbasisinBackbone.Olderbrowsersthatdon'tsupportpushStatewillcontinuetousehash-basedURLfragments,andifahashURLisvisitedbyapushState-capablebrowser,itwillbetransparentlyupgradedtothetrueURL.NotethatusingrealURLsrequiresyourwebservertobeabletocorrectlyrenderthosepages,soback-endchangesarerequiredaswell.Forexample,ifyouhavearouteof/documents/100,yourwebservermustbeabletoservethatpage,ifthebrowservisitsthatURLdirectly.Forfullsearch-enginecrawlability,it'sbesttohavetheservergeneratethecompleteHTMLforthepage...butifit'sawebapplication,justrenderingthesamecontentyouwouldhavefortherootURL,andfillingintherestwithBackboneViewsandJavaScriptworksfine.看不太懂这一段,能举一个例子吗?
Qyouu
相关分类