Backbone.js without client

I'm looking into using Backbone.js and node.js to write a small web app. Sharing code between the client and sever is attractive.

I can't figure out how clients without JS (and search engines) should interact with the site. How should form validations and rendering work with no client-side JavaScript work?

Of course, I'd like to do this without code duplication. Seems to me the point of Backbone.js and other server-side js is that you can have the same form validations and template/view generation on the server AND client.


If you have your view coded with javascript, search engines are buggered as they conform to a more traditional web (one url, one state, one page) and don't understand javascript.

You need to use graceful up-gradation if you want to provide a rich experience and support search engines.

With graceful up-gradation, you code your website with no client side javascript, get it all working nice a nifty. Then you use javascript to upgrade the experience. In most cases this is actually easier, as the upgrade process can be automated. See https://github.com/browserstate/ajaxify


Validating the form data on the client side is a good practice because it saves a user from potentially having to re-enter what was written if it does not validate on the server. Validating on the client side does not remove the need to validate on the server, as your question helps point out, because there is no guarantee JavaScript will be running or even that the form used is the one on your server.

链接地址: http://www.djcxy.com/p/65062.html

上一篇: Backbone和Django,找到了更好的客户

下一篇: 没有客户端的Backbone.js