最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Can a Backbone.js app be progressively enhanced, and crawlable by search engines? - Stack Overflow

programmeradmin1浏览0评论

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'?

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

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'?

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

Share Improve this question asked Oct 18, 2011 at 9:53 joecritchjoecritch 1,1052 gold badges10 silver badges26 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 21

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

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/

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/

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/

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/

Hope that helps

Im not really sure if I understand your question the right way. I think you have some data and you want to work with it on the server side using rails and then provide it to your javascript and proceed working with the data? Thats right?

Then yes thats possible. Lets say you have a model called article and you access one article by the following url:

http://site.com/articles/1

then you can add an .xml

http://site.com/articles/1.xml

and you will get xml and of cause Javascript can parse xml. This is the default setting of rails.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论