本文介绍了可以在Backbone.js的应用逐步提高,并通过搜索引擎抓取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现我的下一个项目中的MVC JavaScript框架,但它不亚于一个网站,因为它是一个Web应用程序。是否有可能公开数据服务器端,然后解析URL以显示JS版本?

I need to implement an MVC JavaScript framework for my next project, but it's as much as a website as it is a web app. Is it possible to expose the data server-side, then parse the URL to show the 'JS version'?

(我计划使用Rails的服务器端code)

(I plan on using Rails for server-side code)

推荐答案

我写了一个小博客一系列正是这个问题...

I wrote a small blog series on exactly this subject...

第一部分介绍了此问题和previous解决方案,以及当前的解决方案:HTML5的pushState的(历史API)

The first part introduces the problem and the previous solutions, as well as the current solution: HTML5's PushState (history API)

http://lostechies.com/derickbailey/2011/09/26/seo-and-accessibility-with-html5-pushstate-part-1-introducing-pushstate/

第2部分展示了如何使用渐进增强与骨干网,这样,当你有你的服务器渲染HTML,那么你可以有你的骨干code接管现有的HTML内容,而不是呈现新的内容:

Part 2 shows how to use progressive enhancement with Backbone, so that when you have your server render HTML you can then have your Backbone code take over the existing HTML content instead of rendering new content:

http://lostechies.com/derickbailey/2011/09/26/seo-and-accessibility-with-html5-pushstate-part-2-progressive-enhancement-with-backbone-js/

第3部分是presentation我给关于这个问题的(有点模糊)的视频,在一次会议上:

Part 3 is a (slightly blurry) video of a presentation I gave on this subject, at a conference:

http://lostechies.com/derickbailey/2011/10/06/seo-and-accessibility-with-html5-pushstate-part-3-the-video/

虽然它不能直接这个小系列的一部分,我也写了关于使用路由器与pushState的博客文章。该职位的要点是:你不需要路由器:

And while it's not directly a part of this little series, I also wrote a blog post about using Routers with PushState. The gist of that post is: you don't need a router:

http://lostechies.com/derickbailey/2011/10/17/tips-for-using-backbone-js-routers-with-html5-pushstate/

希望帮助

这篇关于可以在Backbone.js的应用逐步提高,并通过搜索引擎抓取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 21:42